1

We are creating an web application that displays a chart of electricity meters data. We receive it in the form of a json array and parse it into regular Javascript date objects and values. We use the Google visualization api for displaying this data.

Everything works as expected, only when we request data from the 30th March we receive an "error" (as returned by Google chart). The following code is a simplified version where dataTable 'data' is creating the error and the dataTable 'datab' is not creating any errors:

function drawVisualization() {
  // Some raw data (not necessarily accurate)
  var data = google.visualization.arrayToDataTable([
    ['Sequence', 'Usage'],
    [new Date("2014-03-30T01:30:00+01:00"), 10],
    [new Date("2014-03-30T01:45:00+01:00"), 135],
    [new Date("2014-03-30T03:00:00+02:00"), 157],
    [new Date("2014-03-30T03:15:00+02:00"), 139],
    [new Date("2014-03-30T03:30:00+02:00"), 136]
  ]);

  var datab = google.visualization.arrayToDataTable([
    ['Sequence', 'Usage'],
    [new Date("2014-03-30T01:30:00+01:00"), 10],
    [new Date("2014-03-30T01:45:00+01:00"), 135]
  ]);

  // Create and draw the visualization.
  var ac = new google.visualization.AreaChart(document.getElementById('visualization'));
  ac.draw(data, {
    title: 'Monthly Coffee Production by Country',
    isStacked: true,
    width: 600,
    height: 400
  });
}

google.setOnLoadCallback(drawVisualization);

A plnkr of this code can be found on the following link: link Please keep in mind that I am located in UTC+1 and the error might not show in all time zones.

Thanks

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.