Thanks for reporting this. For some reason, the string notation for dates and datetimes is not working. Until we fix it, you will have to use JavaScript date constructors. e.g. new Date(2017, 2, 17, 10, 49, 21) without the quotes.
On Wed, Mar 15, 2017 at 8:07 AM, Dmitry Tumannik <[email protected]> wrote: > Hello. > I'm in trouble with that. > > function drawChart() { > > var chart = new > google.visualization.AnnotationChart(document.getElementById('chart_div')); > > function updateData () { > $.ajax({ > url: 'getData.php', > dataType: 'json', > success: function (json) { > data = new google.visualization.DataTable(json); > data.addColumn('datetime', 'Date'); > data.addColumn('number', 'Number'); > data.addRows(json); > chart.draw(data); > }, > error: function() { > console.log('nodata'); > } > }); > } > > setTimeout(function () { > updateData(); > }, 1000); > > } > > > getData: > > $string = file_get_contents("testData.json"); > echo $string; > > > JSON: > > [ > ["Date(2017, 2, 17, 10, 49, 21)",386],["Date(2017, 2, 17, 10, 51, > 15)",452],["Date(2017, 2, 17, 10, 50, 35)",327] > ] > > > What I am doing wrong? > > -- > 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 google-visualization-api@ > googlegroups.com. > 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/73de14b5-efd2-4f16-9b2d- > 43921b83956a%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/73de14b5-efd2-4f16-9b2d-43921b83956a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- 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/CAOtcSJOfM2aDQQ7X0pnNMdgyr2L5oCve07iAjFTq6W9dUGUytg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
