Trying to dynamically build a line chart using the Google Charts API. 

This is the error being returned: 

`Value 2018-05-06T11:15:00-0400 does not match type datetime in column 
index`

Without even looking at code, the error message is super confusing as that 
is the ISO8601 format described in the documentation 
here: https://developers.google.com/chart/interactive/docs/datesandtimes

Here is the code building the chart: 

var data = new google.visualization.DataTable();

      for (var i = 0; i < chartData['cols'].length; i++) {
        data.addColumn(chartData['cols'][i].type, chartData['cols'][i].id);
      }

      for (var i = 0; i < chartData['rows'].length; i++) {
        data.addRow(chartData['rows'][i]);
      }

      var view = new google.visualization.DataView(data);


Here is a sample of chartData: 

chartData = {
"cols":[
{"id":"created_dt","type":"datetime"},
{"id":"Label 123","type":"number"},
{"id":"Label 124","type":"number"},
{"id":"Label 125","type":"number"},
{"id":"Label 126","type":"number"},
{"id":"Label 127","type":"number"}
],
"rows":[
["2018-05-06T11:15:00-0400",0.10,0.0,10,0.10,0.12],
["2018-05-06T11:30:00-0400",0.40,0,0.14,0.01,0.17],
["2018-05-06T11:45:00-0400",0.33,0,0.38,0.08,0.20],
["2018-05-06T12:00:00-0400",0.33,0,0.56,0.10,0.23],
["2018-05-06T12:15:00-0400",0.23,0,0.64,0.07,0.33]
]
}

Any help on what I'm doing wrong here would be much appreciated. 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/a4eeb226-f294-4681-b664-261cba3c7640%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to