-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
58 lines (52 loc) · 1.55 KB
/
test.html
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
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', { 'packages': ['bar'] });
google.charts.setOnLoadCallback(drawStuff);
function drawStuff() {
var data = new google.visualization.arrayToDataTable([
['Type of Crime', 'Recorded Cases'],
["Homicide", 44],
["Immorality Offences", 31],
["Robbery", 12],
["Breakings", 10],
['Stock Theft', 3],
["Stealing", 44],
["Theft By Servants", 31],
["Vehicle Theft", 12],
["Drugs", 100],
['Traffic', 3],
["Criminal Damages", 44],
["Economy Crimes", 31],
["Corruption", 12],
["Police Offences", 10],
['Tourists Offences', 3],
["Penal Code", 44],
]);
var options = {
title: 'Crime Mapping',
width: 600,
legend: { position: 'none' },
chart: {
title: 'Crime Mapping',
subtitle: 'Distribution of Crimes in Kenya'
},
bars: 'horizontal', // Required for Material Bar Charts.
colors: ['red', '#004411'],
axes: {
x: {
0: { side: 'top', label: 'Cases' } // Top x-axis.
}
},
bar: { groupWidth: "90%" }
};
var chart = new google.charts.Bar(document.getElementById('top_x_div'));
chart.draw(data, options);
};
</script>
</head>
<body>
<div id="top_x_div" style="width: 600px; height: 500px;"></div>
</body>
</html>