Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
How to select certain time period in d3 js?

Here is a radial line chart I found online: https://bl.ocks.org/tlfrd/fd6991b2d1947a3cb9e0bd20053899d6

I want to visualize the data between Oct 2016 to Feb 2017. How should I do that for this code?

Thanks!!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Modify your code as the following:

function(error, data) {
  if (error) throw error;

  const fromTime = new Date('2016-10-01').getTime();
  const toTime = new Date('2017-03-01').getTime();

  data = data.filter(d => {
    const time = d.Date.getTime();
    return time >= fromTime && time < toTime;
  });

  x.domain(d3.extent(data, function(d) { return d.Date; }));
  y.domain(d3.extent(data, function(d) { return d.Close; }));
  ...
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!