-
Notifications
You must be signed in to change notification settings - Fork 1
/
charts.php
104 lines (86 loc) · 3.18 KB
/
charts.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>iHome</title>
<!-- Bootstrap core CSS -->
<link href="css/min_ss.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/business-frontpage.css" rel="stylesheet">
<style type="text/css">
.navbar-brand {
font-size: 15px;
font-weight: lighter;
font-family: sans-serif;
color: grey;
}
body {
background-color: whitesmoke;
}
.p{
opacity: 0.3;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="home.php">Home</a>
<a class="navbar-brand" href="index.php">Logout</a>
</div>
</nav>
<!-- Header with Background Image -->
<header class="business-header" style="min-height: 140px;background-image:url(resources/images/frequency.jpg)">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="display-3 text-center mt-4" style="font-weight:bold;font-size: 40px;color: sandybrown;font-style: italic;font-family:times new roman;padding-bottom:1">iReport Incident Statistics</h1>
<br>
</div>
</div>
</div>
</header>
<br>
<div class="container">
<p style="font-weight: 500">In order to better deal with the challenges facing the Kenyan Transport Industry, we need to understand and analyze these incidences and their frequency.</p>
<hr>
</div>
<div class="container" id="piechart" align="center">
<p class="p">This page requires online connectivity.</p>
</div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load google charts
google.charts.load('current', {
'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);
// Draw the chart and set the chart values
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Location', 'Frequency'],
['Nakuru', 10],
['Nairobi', 24],
['Mombasa', 14],
['Eldoret', 8],
['Kisumu', 12],
['Naivasha', 6]
]);
// Optional; add a title and set the width and height of the chart
var options = {
pieHole: 0.3,
'title': 'Incident Frequency by Location',
'width': 700,
'height': 700
};
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</body>
</html>