-
Notifications
You must be signed in to change notification settings - Fork 19
/
statistics.php
134 lines (121 loc) · 3.79 KB
/
statistics.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
include_once "db.php";
include_once "header.php";
include_once "sidebar.php";
?>
<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([
['Employee', 'Count'],
['Manager', 2],
['Cleaning', 14],
['Reception', 4],
['Cook', 5],
]);
var options = {
title: 'Type of Employees',
is3D: true,
};
var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));
chart.draw(data, options);
}
</script>
<style>
#piechart_3d{
width: 400px;
height: 400px;
margin-left : 300px;
}
#barchart_values{
width: 400px;
height: 400px;
margin-left : 800px;
margin-top :-400px;
}
#calendar_basic{
width: 1000px;
height: 250px;
margin-left : 300px;
}
</style>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
["Type", "Expense", { role: "style" } ],
["Maintanence", 8.94, "#b87333"],
["Salary", 10.49, "silver"],
["Electric Bills", 19.30, "gold"],
["External Services", 21.45, "color: #e5e4e2"]
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);
var options = {
title: "Hotel Expense",
width: 600,
height: 400,
bar: {groupWidth: "95%"},
legend: { position: "none" },
};
var chart = new google.visualization.BarChart(document.getElementById("barchart_values"));
chart.draw(view, options);
}
</script>
<script type="text/javascript">
google.charts.load("current", {packages:["calendar"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'date', id: 'Date' });
dataTable.addColumn({ type: 'number', id: 'Room Booked' });
dataTable.addRows([
[ new Date(2017, 3, 13), 6 ],
[ new Date(2017, 3, 14), 7 ],
[ new Date(2017, 3, 15), 2 ],
[ new Date(2017, 3, 16), 3 ],
[ new Date(2017, 3, 17), 3 ],
//
[ new Date(2017, 4, 13), 5 ],
[ new Date(2017, 4, 14), 9 ],
[ new Date(2017, 4, 15), 5 ],
[ new Date(2017, 4, 16), 6 ],
[ new Date(2017, 4, 17), 2 ],
// Many rows omitted for brevity.
[ new Date(2017, 9, 4), 3 ],
[ new Date(2017, 9, 5), 5],
[ new Date(2017, 9, 12), 6],
[ new Date(2017, 9, 13), 7],
[ new Date(2017, 9, 19), 1 ],
[ new Date(2017, 9, 23), 3],
[ new Date(2017, 9, 24), 5],
[ new Date(2017, 9, 30), 2 ]
]);
var chart = new google.visualization.Calendar(document.getElementById('calendar_basic'));
var options = {
title: "Reserved Room on Different Day",
height: 350,
};
chart.draw(dataTable, options);
}
</script>
</head>
<body>
<div id="piechart_3d"></div>
<div id="barchart_values"></div><br><br><br>
<div id="calendar_basic"></div>
</body>
</html>
<?php
include_once "footer.php";
?>