-
Notifications
You must be signed in to change notification settings - Fork 0
/
rainanaly.html
123 lines (118 loc) · 3.19 KB
/
rainanaly.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
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rainfall Analytics Dashboard</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 20px;
}
h1 {
text-align: center;
}
.dashboard {
display: flex;
justify-content: space-around;
margin-top: 20px;
}
table {
width: 45%;
border-collapse: collapse;
background-color: #fff;
}
th, td {
padding: 12px;
text-align: center;
border: 1px solid #ddd;
}
th {
background-color: #007bff;
color: white;
}
.chart-container {
width: 45%;
height: 400px;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<h1>Rainfall Analytics Dashboard</h1>
<div class="dashboard">
<table>
<thead>
<tr>
<th>Region</th>
<th>Rainfall (mm)</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Region A</td>
<td>120</td>
<td>2024-10-01</td>
</tr>
<tr>
<td>Region B</td>
<td>80</td>
<td>2024-10-01</td>
</tr>
<tr>
<td>Region C</td>
<td>50</td>
<td>2024-10-01</td>
</tr>
<tr>
<td>Region D</td>
<td>200</td>
<td>2024-10-01</td>
</tr>
</tbody>
</table>
<div class="chart-container">
<canvas id="rainfallChart"></canvas>
</div>
</div>
<script>
const ctx = document.getElementById('rainfallChart').getContext('2d');
const rainfallChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Bangladesh', 'nepal', 'Thailand', 'India'],
datasets: [{
label: 'Rainfall (mm)',
data: [120, 80, 50, 200],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Rainfall (mm)'
}
}
}
}
});
</script>
</body>
</html>