-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphMinPei.js
35 lines (30 loc) · 932 Bytes
/
graphMinPei.js
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
window.onload = function minPereira() {
var dataPoints = [];
var chart = new CanvasJS.Chart("chartContainer1", {
animationEnabled: true,
theme: "light2",
title: {
text: "Minimos Pereira en todas las Estaciones"
},
axisY: {
title: "µg/m3",
titleFontSize: 24
},
data: [{
type: "line",
yValueFormatString: "#,### µg/m3",
dataPoints: dataPoints
}]
});
function addData(data) {
for (var i = 0; i < data.length; i++) {
dataPoints.push(
{x: new Date(data[i].a_o),
y: parseInt(data[i].dato_m_nimo_g_m3)
});
console.log(data[i].dato_m_nimo_g_m3);
}
chart.render();
}
$.getJSON("https://www.datos.gov.co/resource/a2ud-mjag.json?ciudad=Pereira", addData);
}