<?php
include ('connection.php');
?>
<html>
<head>
<title>Google Charts Tutorial</title>
<script type = "text/javascript" src = "https://www.gstatic.com/charts/loader.js">
</script>
<script type = "text/javascript" src = "https://www.google.com/jsapi">
</script>
<script type = "text/javascript">
google.charts.load('current', {packages: ['corechart']});
</script>
</head>
<body>
<div id = "container" style = "width: 550px; height: 400px; margin: 0 auto">
</div>
<script language = "JavaScript">
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Month', 'Performance %'],
<?php
$query = "SELECT month , result_ind FROM performance GROUP BY month";
$exec = mysqli_query($db,$query);
while($row = mysqli_fetch_assoc($exec)){
echo "['".$row['month']."',".$row['result_ind']."],";
}
?>
]);
// Set chart options
var options = {
'title':'Month vs %',
'width':550,
'height':400,
trendlines: {
0: {
type: 'exponential',
color: 'green',
visibleInLegend: true,
}
} // Draw a trendline for data series 0.
};
// Instantiate and draw the chart.
var chart = new google.visualization.ScatterChart(document.getElementById('container'));
chart.draw(data, options);
}
google.charts.setOnLoadCallback(drawChart);
</script>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups "Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chart-a...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chart-api/f319de46-86dd-4c57-ba6a-f37a313ca182%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chart-api/f319de46-86dd-4c57-ba6a-f37a313ca182%40googlegroups.com.
--dlali...@Google.com Cambridge MA