This is my code:
<html>
<?php
mysql_connect("localhost","root","");
mysql_select_db("sperformance");
$query="SELECT * FROM stud_details WHERE email='[email protected]'";
$result = mysql_query($query) or die ("Error in query: $query.
".mysql_error());
while($row = mysql_fetch_row($result)) {
?>
<head>
<script type="text/javascript"
src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['x', 'CGPA' ],
['Semester 1', <?php echo $row[1] ?> ],
['Semester 2', <?php echo $row[2] ?> ],
['Semester 3', <?php echo $row[3] ?> ],
['Semester 4', <?php echo $row[4] ?> ],
['Semester 5', <?php echo $row[5] ?> ],
['Semester 6', <?php echo $row[6] ?> ],
['Semester 7', <?php echo $row[7] ?> ],
['Semester 8', <?php echo $row[8] ?> ],
['Semester 9', <?php echo $row[9] ?> ],
['Semester 10', <?php echo $row[10] ?> ],
['Semester 11', <?php echo $row[11] ?> ],
['Semester 12', <?php echo $row[12] ?> ],
]);
var options = {
title: 'Student Performance'
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 1300px; height: 500px;"></div>
</body>
<?php
}
?>
</html>
I don't know why the graph did not appear. Anyone can help me? Thank you.
--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.