aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/js/AllDataChart.js16
-rw-r--r--web/js/LastWeekDataChart.js16
2 files changed, 8 insertions, 24 deletions
diff --git a/web/js/AllDataChart.js b/web/js/AllDataChart.js
index 8de05cf..6525382 100644
--- a/web/js/AllDataChart.js
+++ b/web/js/AllDataChart.js
@@ -22,10 +22,7 @@ var datasets = [{
borderColor: "rgb(246, 250, 15)",
fill: false,
data: []
-}]
-
-
-
+}];
fetch('/AllDataAverage')
.then(function(response) {
@@ -33,28 +30,23 @@ fetch('/AllDataAverage')
})
.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,
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,