diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2017-12-07 12:50:32 +0100 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2017-12-07 12:50:32 +0100 |
commit | df1411e42481f8e788b9b40e3375715979bc7a0c (patch) | |
tree | 3ae7c9d572a521ed244a46de5a01726635b4a1e0 | |
parent | 322b79babf45b1bff0d219cfbf10524b975075fd (diff) |
Fixes.
-rw-r--r-- | app/Resources/views/base.html.twig | 4 | ||||
-rw-r--r-- | web/js/AllDataChart.js | 16 | ||||
-rw-r--r-- | web/js/LastWeekDataChart.js | 16 |
3 files changed, 10 insertions, 26 deletions
diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index b4cc11a..36b2851 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -14,10 +14,10 @@ <img src="https://cdn3.iconfinder.com/data/icons/christmas-icon-set-pixel-perfect/64/christmas-color-12-512.png" alt="Pollutometer" width="50px" height="auto"> <span>Pollutometer</span> </a> - <a class="navbar-item" href="/{{ path('AllData') }}"> + <a class="navbar-item" href="/AllData"> <span>All Data</span> </a> - <a class="navbar-item" href="/{{ path('LastWeekData') }}"> + <a class="navbar-item" href="/LastWeekData"> <span>Last Week Data</span> </a> </div> 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, |