Mercurial > gemma
diff client/src/components/gauge/Waterlevel.vue @ 2596:8774054959a7
client: added Gauges dialog/tool to show waterlevel diagrams
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 12 Mar 2019 12:07:02 +0100 |
parents | 1686ec185155 |
children | 85f9bf4a6eba |
line wrap: on
line diff
--- a/client/src/components/gauge/Waterlevel.vue Tue Mar 12 11:44:29 2019 +0100 +++ b/client/src/components/gauge/Waterlevel.vue Tue Mar 12 12:07:02 2019 +0100 @@ -37,18 +37,11 @@ export default { computed: { - ...mapState("gauges", ["selectedGauge"]), + ...mapState("gauges", ["selectedGauge", "waterlevels"]) + }, + watch: { waterlevels() { - let data = []; - let waterlevel = 2.5; - for (let i = 1; i <= 365; i++) { - let date = new Date(); - date.setFullYear(2018); - date.setDate(date.getDate() + i); - waterlevel *= Math.random() * (1.02 - 0.98) + 0.98; - data.push({ date, waterlevel }); - } - return data; + this.drawDiagram(); } }, methods: {