-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.php
51 lines (43 loc) · 1.1 KB
/
demo.php
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
43
44
45
46
47
48
49
50
51
<?php
$dataPoints = array(
array("label"=>"Chrome", "y"=>64.02),
array("label"=>"Firefox", "y"=>12.55),
array("label"=>"IE", "y"=>8.47),
array("label"=>"Safari", "y"=>6.08),
array("label"=>"Edge", "y"=>4.29),
array("label"=>"Others", "y"=>4.59)
)
?>
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
title: {
text: "Usage Share of Desktop Browsers"
},
subtitles: [{
text: "November 2017"
}],
data: [{
type: "pie",
yValueFormatString: "#,##0.00\"%\"",
indexLabel: "{label} ({y})",
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://cdn.canvasjs.com/canvasjs.min.js"></script>
</body>
</html>
foreach ($results as $result) {
echo "<p>Phone number: " . htmlspecialchars($result['phone']) . "</p>";
echo "<p>Name: " . htmlspecialchars($result['name']) . "</p>";
}