hi, I'm trying to create a chart from data in sqlite, I would like to see
the temperature, but I have some difficulty, I attach the code, someone can
help me? thanks for your patience
<?php $day = date("d"); $month = date("m"); $year = date("Y"); $cal1 =
array($dayy,$month,$year); $cal1=implode(".", $cal1); $db = new
PDO("sqlite:/db/storage.db"); ?> <html> <head> <script
type="text/javascript" src="http://www.google.com/jsapi"></script> <script
type="text/javascript"> google.load("visualization", "1",
{packages:["linechart"]}); google.setOnLoadCallback(drawChart); function
drawChart() { var data = new google.visualization.DataTable();
data.addColumn('number', 'Temperature'); <?php $sql = $db->prepare("SELECT
* FROM home WHERE day='$day' and year='$year' and month='$month'");
$sql->execute(); $result = $sql->fetchAll(); foreach($result as $row) {
echo "data.addRow( $row['temp'])"; } ?> var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, { width: 500, height: 240, legend: 'right', title: 'Home'
}); } </script> </head> <body> <div id="chart_div"></div> </body> </html>
--
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/7ee5212b-7a16-4632-84f1-da47e364d0af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.