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

92
Views
Line Chart not accepting date as column 0?

I have a table on which when the user clicks it generates a line chart for the selected row. The column 0 of the line chart is a string date so I want to format it to Date() in order to apply the DateRange Filter. I do the following

data.yearChart.forEach(row => {
  let dato =  new Date(row[0]);
  if(dato != "Invalid Date" ){
      row[0] = dato;
  }
  console.log(row);
});

In console log I see that all the rows get to be correctly turned to Date object but the chart throws a.getTime() is not a function. So actually if I add the filter now, it appears correctly but the chart is still not drawn. I also have a Date formatter for the chart but it doesn't seem to do anything.

 var formatChart = new google.visualization.DateFormat({formatType: 'short'});
 formatChart.format(dataYear, 0);
 dateSlider.draw();
 chart.draw(dataYear, options);

That's pretty weird since line chart accepts date objects. I would upload more code snippets but the project got pretty chonky at this point and will do it only if needed.

So my question is, how can I make the line chart load with the dates so the date range filter can be applied?

Edit: my json data get loaded on click from php file

about 4 years ago · Juan Pablo Isaza
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!