aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2017-12-07 12:50:32 +0100
committermarcinzelent <zelent.marcin@gmail.com>2017-12-07 12:50:32 +0100
commitdf1411e42481f8e788b9b40e3375715979bc7a0c (patch)
tree3ae7c9d572a521ed244a46de5a01726635b4a1e0 /web/js/LastWeekDataChart.js
parent322b79babf45b1bff0d219cfbf10524b975075fd (diff)
Fixes.
Diffstat (limited to 'web/js/LastWeekDataChart.js')
-rw-r--r--web/js/LastWeekDataChart.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/web/js/LastWeekDataChart.js b/web/js/LastWeekDataChart.js
index a24d51a..b5e3976 100644
--- a/web/js/LastWeekDataChart.js
+++ b/web/js/LastWeekDataChart.js
@@ -22,10 +22,7 @@ var datasets = [{
borderColor: "rgb(246, 250, 15)",
fill: false,
data: []
-}]
-
-
-
+}];
fetch('/LastWeekDataAverage')
.then(function(response) {
@@ -33,28 +30,23 @@ fetch('/LastWeekDataAverage')
})
.then(function(data) {
drawChart(data, datasets);
- })
-
-
-
-
+ });
function drawChart(gasData, datasets) {
var finishedData = {
labels: []
- }
+ };
Object.keys(gasData).forEach(function(key) {
finishedData.labels.push(key);
- datasets[0].data.push(gasData[key].Co)
+ datasets[0].data.push(gasData[key].Co);
datasets[1].data.push(gasData[key].No);
datasets[2].data.push(gasData[key].So);
});
finishedData.datasets = datasets;
-
var myLineChart = new Chart(ctx, {
type: 'line',
data: finishedData,