-
Notifications
You must be signed in to change notification settings - Fork 1
/
report3.php
57 lines (49 loc) · 1.83 KB
/
report3.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
52
53
54
55
56
57
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
["Element", "Density", { role: "style" } ],
["", 0, ""],
// ["bb", 2, "blue"],
// ["Gold", 19.30, "blue"],
// ["Platinum", 21.45, "blue"]
// ]);
<?php
$color = "green";
$conn = mysqli_connect("localhost", "root", "", "vaccineregistration");
$sql = "SELECT COUNT(*) as total, vaccine_date FROM bookedSlots GROUP BY vaccine_date ";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result)) {
// echo $row['total']." ".$row['vaccine_date']."<br>";
// echo gettype($row['center_district_name'])." ".gettype((int)$row['counter'])."<br>";
echo "['".$row['vaccine_date']."', '".(float)$row['total']."', '".$color."'],";
}
?>
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);
var options = {
// title: "Density of Precious Metals, in g/cm^3",
width: 600,
height: 400,
bar: {groupWidth: "95%"},
legend: { position: "none" },
};
var chart = new google.visualization.ColumnChart(document.getElementById("columnchart_values"));
chart.draw(view, options);
}
</script>
</head>
<body>
<div id="columnchart_values" style="width: 900px; height: 300px;"></div>
</body>
</html>