Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

99
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda