just notice that google charts is 0 based.... so just put -1 when getting the result!
sexta-feira, 5 de Outubro de 2018 às 00:25:09 UTC+1, Joao castro pereira escreveu: > > im developing a chart that show the price evolution over time. > > When i was developing in my local server i could use a php while inside de > script.. but after deployment for online server it no longer works. > > the code i have now is: > > <script type="text/javascript" src=" > https://www.gstatic.com/charts/loader.js"> > > > > > > > <script type="text/javascript"> > google.charts.load('current', {'packages':['corechart']}); > google.charts.setOnLoadCallback(drawChart); > > function drawChart() { > > var data = new google.visualization.DataTable(); > data.addColumn('date', 'Team'); > data.addColumn('value', 'Season Start Date'); > data.addRows( > > > > > <?php echo $dados;?> > > ]); > > > > var options = { > > 'backgroundColor': 'transparent', > 'curveType': 'function', > 'is3D':true > }; > > var chart = new > google.visualization.LineChart(document.getElementById('curve_chart')); > > chart.draw(data, options); > } > </script> > > notice that the output from my $dados is: > > [2018-09-06, 2.00],[2018-09-07, 2.00],[2018-09-07, 2.10],[2018-09-08, > 2.00],[2018-09-12, 2.95],[2018-09-12, 2.00],[2018-09-13, 2.10],[2018-09-13, > 2.10],[2018-10-04, 2.10],[2018-10-04, 2.10],[2018-10-04, 2.10], > > but still no idea why it isn't working... > > help please!! > -- 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/8d35e8df-7cdc-455f-aa0a-48e8fe803ada%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
