-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.php
More file actions
42 lines (38 loc) · 913 Bytes
/
sample.php
File metadata and controls
42 lines (38 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$dataPoints = array(
array("y" => 5, "label" => "Unsatisfactory Ratings" ),
array("y" => 12, "label" => "Satisfactory Ratings" ),
array("y" => 50, "label" => "Good Ratings" ),
array("y" => 32, "label" => "Very Good Ratings" ),
array("y" => 54, "label" => "Excellent Ratings" ),
);
?>
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
theme: "light2",
title:{
text: "Subject Knowledge"
},
axisY: {
title: "Number of students"
},
data: [{
type: "column",
yValueFormatString: "#,##0.## students",
dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?>
}]
});
chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</body>
</html>