-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstats.html
114 lines (111 loc) · 4.06 KB
/
stats.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Yearly analysis of groundwater levels in various states of India.">
<title>Groundwater Levels Analysis</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="icon" href="logoh1.png" type="image/x-icon">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f8f9fa;
text-align: center;
}
canvas {
max-width: 90%;
margin: 20px auto;
}
</style>
</head>
<body>
<h1>Yearly Groundwater Levels Analysis</h1>
<p>Analysis of groundwater levels (in meters) for Rajasthan, Maharashtra, Karnataka, Bihar, and West Bengal.</p>
<canvas id="groundwaterChart"></canvas>
<script>
// Data for the graph
const labels = [2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023];
const data = {
labels: labels,
datasets: [
{
label: 'Rajasthan',
data: [35, 34.5, 34.2, 34.8, 35.1, 34.9, 34.6, 34.7, 34.3],
borderColor: 'rgb(255, 99, 132)',
backgroundColor: 'rgba(255, 99, 132, 0.2)',
fill: true,
},
{
label: 'Maharashtra',
data: [22, 21.8, 21.5, 21.7, 21.9, 21.6, 21.3, 21.5, 21.2],
borderColor: 'rgb(54, 162, 235)',
backgroundColor: 'rgba(54, 162, 235, 0.2)',
fill: true,
},
{
label: 'Karnataka',
data: [28, 27.5, 27.3, 27.4, 27.8, 27.6, 27.2, 27.5, 27.1],
borderColor: 'rgb(75, 192, 192)',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
fill: true,
},
{
label: 'Bihar',
data: [12, 11.9, 11.8, 11.7, 11.9, 11.6, 11.4, 11.7, 11.3],
borderColor: 'rgb(255, 205, 86)',
backgroundColor: 'rgba(255, 205, 86, 0.2)',
fill: true,
},
{
label: 'West Bengal',
data: [18, 17.8, 17.5, 17.6, 17.9, 17.7, 17.4, 17.5, 17.2],
borderColor: 'rgb(153, 102, 255)',
backgroundColor: 'rgba(153, 102, 255, 0.2)',
fill: true,
}
]
};
// Configuration options
const config = {
type: 'line',
data: data,
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
title: {
display: true,
text: 'Groundwater Levels (2015-2023)'
}
},
scales: {
y: {
beginAtZero: false,
title: {
display: true,
text: 'Water Level (meters below ground)'
}
},
x: {
title: {
display: true,
text: 'Year'
}
}
}
}
};
// Render the chart
const groundwaterChart = new Chart(
document.getElementById('groundwaterChart'),
config
);
</script>
</body>
</html>