FYI, this is a workaround for anyone who is interested: 

var dateArray = ({{ ganttdata|safe }});
      for(var i = 0; i < dateArray.length; i++){
        dateArray[i][0] = new Date(dateArray[i][0]); // Set dateArray[i][0] 
to a `new Date()` with as value the string in `dateArray[i][0]`;
      }
      
        // Some raw data (not necessarily accurate)
      var data = new google.visualization.DataTable();
      data.addColumn('date', 'Week');
      data.addColumn('number', 'Planned Dollars');
      data.addRows(dateArray);

On Friday, September 8, 2017 at 9:17:16 AM UTC-5, Matt wrote:
>
> Why does the format below not accept dates in this format: [["Date(2017, 
> 09, 10)", 7116.0],...
>
> var data = new google.visualization.DataTable();
>         data.addColumn('date', 'Time of Day');
>         data.addColumn('number', 'Rating');
>
>         data.addRows([
>           [new Date(2015, 0, 1), 5],  [new Date(2015, 0, 2), 7],  [new 
> Date(2015, 0, 3), 3],
>           [new Date(2015, 0, 4), 1],  [new Date(2015, 0, 5), 3],  [new 
> Date(2015, 0, 6), 4],
>           [new Date(2015, 0, 7), 3],  [new Date(2015, 0, 8), 4],  [new 
> Date(2015, 0, 9), 2],
>           [new Date(2015, 0, 10), 5], [new Date(2015, 0, 11), 8], [new 
> Date(2015, 0, 12), 6],
>           [new Date(2015, 0, 13), 3], [new Date(2015, 0, 14), 3], [new 
> Date(2015, 0, 15), 5],
>           [new Date(2015, 0, 16), 7], [new Date(2015, 0, 17), 6], [new 
> Date(2015, 0, 18), 6],
>           [new Date(2015, 0, 19), 3], [new Date(2015, 0, 20), 1], [new 
> Date(2015, 0, 21), 2],
>           [new Date(2015, 0, 22), 4], [new Date(2015, 0, 23), 6], [new 
> Date(2015, 0, 24), 5],
>           [new Date(2015, 0, 25), 9], [new Date(2015, 0, 26), 4], [new 
> Date(2015, 0, 27), 9],
>           [new Date(2015, 0, 28), 8], [new Date(2015, 0, 29), 6], [new 
> Date(2015, 0, 30), 4],
>           [new Date(2015, 0, 31), 6], [new Date(2015, 1, 1), 7],  [new 
> Date(2015, 1, 2), 9]
>         ]);
>
>

-- 
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/1c597222-2a5d-457b-bc66-e865e8967168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to