-
Notifications
You must be signed in to change notification settings - Fork 0
/
Maharashtra.html
100 lines (86 loc) · 2.99 KB
/
Maharashtra.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
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
<!DOCTYPE html>
<html>
<head>
<title>Crime in Maharashtra</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
section {
padding: 20px;
}
h2 {
color: #333;
font-size: 24px;
margin-bottom: 10px;
}
.chart-container {
width: 1000px;
height: 700px;
margin: 0 auto;
}
</style>
</head>
<body>
<header>
<h1>Crime in Maharashtra</h1>
</header>
<section>
<h2>Crime Statistics</h2>
<div class="chart-container" id="maharashtra-graph"></div>
<div class="chart-container" id="maharashtra-pie-chart"></div>
<script src="https://www.gstatic.com/charts/loader.js"></script>
<script>
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
google.charts.setOnLoadCallback(drawPieChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Murder', 'Robbery', 'Burglary', 'Assault', 'Fraud'],
['2019', 180, 200, 150, 120, 80],
['2020', 170, 220, 160, 100, 90],
['2021', 200, 240, 180, 150, 110],
['2022', 190, 250, 200, 130, 100]
]);
var options = {
title: 'Crime Trends (2019-2022)',
curveType: 'function',
legend: { position: 'bottom' },
chartArea: { width: '70%', height: '70%' }
};
var chart = new google.visualization.LineChart(document.getElementById('maharashtra-graph'));
chart.draw(data, options);
}
function drawPieChart() {
var data = google.visualization.arrayToDataTable([
['Crime', 'Percentage'],
['Murder', 25],
['Robbery', 15],
['Burglary', 20],
['Assault', 18],
['Fraud', 22]
]);
var options = {
title: 'Crime Distribution',
pieHole: 0.4,
chartArea: { width: '70%', height: '70%' },
colors: ['#FF6F61', '#6B5B95', '#88B04B', '#F7CAC9', '#92A8D1']
};
var chart = new google.visualization.PieChart(document.getElementById('maharashtra-pie-chart'));
chart.draw(data, options);
}
</script>
</section>
<footer>
<p>© 2023 Crime in Maharashtra. All rights reserved.</p>
</footer>
</body>
</html>