hanze/iwa-panda2

Last 5 values in Graph (4b56441ece797c4886a5815e029b5ae22c3c4a3f)
Repositories | README.md

commit 4b56441ece797c4886a5815e029b5ae22c3c4a3f
parent 7f11e5fd6e991893ed61923fef7facc324b99e3e
Author: Kninteman <[email protected]>
Date:   Mon, 12 Jun 2023 20:36:01 +0200

Last 5 values in Graph

Diffstat:
Mjs/panda.js4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/js/panda.js b/js/panda.js @@ -105,8 +105,8 @@ function fetchDataAndUpdateChart() { array.push(point['humidity']); }); let splitDataResult = splitData(data); - myChart.data.datasets[0].data = splitDataResult.chengduData; - myChart.data.datasets[1].data = splitDataResult.kangdingData; + myChart.data.datasets[0].data = splitDataResult.chengduData.splice(-5); + myChart.data.datasets[1].data = splitDataResult.kangdingData.splice(-5); myChart.update(); }) }