-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclimate_change_graph.html
80 lines (77 loc) · 2.09 KB
/
climate_change_graph.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
<html>
<head>
<title>Tucson Airport Temperatures, 1948-2024</title>
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
<style>
.chart-container {
width: 1400px;
height: 800px;
padding-left: 10px;
padding-right: 10px;
margin-left: auto;
margin-right: auto;
display: block;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
</head>
<body>
<div style="margin: 40px 0px">
<center><h2>Tucson Airport Temperatures, 1948-2024</h2>
</center>
</div>
<div class="chart-container" align="center">
<canvas id="myChart"></canvas>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('myChart');
new Chart(ctx, {
type: 'line',
options: {
responsive: true,
// maintainAspectRatio: false
},
data: {
datasets: [
{
label: 'Avg minimum temp per year',
data: {{DATA_MIN}},
borderWidth: 1,
fill: false,
borderColor: 'rgb(0, 0, 192)',
tension: 0.3
},
{
label: 'Avg maximum temp per year',
data: {{DATA_MAX}},
borderWidth: 1,
fill: false,
borderColor: 'rgb(192, 0, 0)',
tension: 0.3
},
{
label: '5-yr running avg min temp per year',
data: {{DATA_MIN_AVG}},
borderWidth: 1,
fill: false,
borderColor: 'rgb(0, 192, 192)',
tension: 0.3
},
{
label: '5-yr running avg max temp per year',
data: {{DATA_MAX_AVG}},
borderWidth: 1,
fill: false,
borderColor: 'rgb(192, 192, 0)',
tension: 0.3
}
]
}
});
</script>
</body>
</html>