Hi All, I'm trying to draw a chart based off some mysql data, and for some reason, the chart is blank.
the code is here :- <html> <head> <script type="text/javascript" src=" https://www.gstatic.com/charts/loader.js"></script> <script type= "text/javascript" src=" http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> </head> <body> <div id="curve_chart" style="width: 900px; height: 500px" ></div> <script type="text/javascript"> google.charts.load('current', { 'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable([ data. addColumn(timeofday,'Time'); data.addColumn(number,'Probe 1'); data. addColumn(number,'Probe 2'); data.addColumn(number,'Probe 3'); data. addColumn(number,'Probe 4'); data.addRows([ [ {"rows":[{"c":[{"v":"03:02:07" },{"v":"270.26"},{"v":"298.40"},{"v":"111.54"},{"v":"228.06"}]},{"c":[{"v": "03:28:42"},{"v":"273.23"},{"v":"190.43"},{"v":"245.69"},{"v":"283.21"}]},{ "c":[{"v":"07:26:04"},{"v":"144.33"},{"v":"217.26"},{"v":"206.53"},{"v": "167.68"}]},{"c":[{"v":"12:13:20"},{"v":"153.15"},{"v":"277.23"},{"v": "167.20"},{"v":"240.88"}]}]} ] ]); var options = { title: 'Recorded Temperatures', legend: { position: 'bottom' }, width: 900, height: 500, hAxis: { format: 'hh:mm:ss' } }; var chart = new google.visualization. LineChart(document.getElementById('curve_chart')); chart.draw(data, options ); } </script> </body> </html> The data shown in data.addRows([ ... is being generated by a php echo, which is a json array. if these values are hard coded into the table, it's fine. If I pull it from the php in this way, the chart doesn't render. -- 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/79519cb6-7a4b-4037-9685-e9e349e2bee4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
