changeset 4143:afc564e0db40

added fixed delta
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 02 Aug 2019 11:01:30 +0200
parents 2a3bd5f3fc99
children 737e1199800f
files client/src/components/gauge/Waterlevel.vue
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/gauge/Waterlevel.vue	Fri Aug 02 10:45:52 2019 +0200
+++ b/client/src/components/gauge/Waterlevel.vue	Fri Aug 02 11:01:30 2019 +0200
@@ -591,8 +591,9 @@
       const y2 = d3.scaleLinear().range([dimensions.navHeight, 0]);
       const [lo, hi] = extent.waterlevel;
       // setting the min and max values for the diagram axes
+      const dy = Math.ceil(0.15 * (hi - lo));
       x.domain(d3.extent(extent.date));
-      y.domain([Math.floor(lo * 0.9), Math.ceil(hi * 1.1)]);
+      y.domain([lo - dy, hi + dy]);
       x2.domain(x.domain());
       y2.domain(y.domain());