]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: fix y-axis range and margins: top+bottom
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Thu, 24 Aug 2017 09:34:59 +0000 (11:34 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Thu, 24 Aug 2017 09:34:59 +0000 (11:34 +0200)
python_suite/dashboard/static/js/sparkline.js

index 94cc089ba1dd0f9ce2725dc4be7afdb3d15c11d0..5d180f0f4aba40797184d8f62771f08a65d3c372 100644 (file)
@@ -72,7 +72,7 @@ function sparkline() {
     var svg = d3.select(chart.selector())
       .append('svg')
         .attr('width', width + margin.left + margin.right)
-        .attr('height', height)
+        .attr('height', height + margin.top + margin.bottom)
       .append('g')
         .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
 
@@ -119,7 +119,8 @@ function sparkline() {
 
       // Scale the range of the data
       x.domain(d3.extent(data, function (d) { return d[0]; }));
-      y.domain([0, d3.max(data, function (d) { return d[1]; })]);
+      y.domain(d3.extent(data, function (d) { return d[1]; }));
+
 
       // Add the valueline path.
       svg.append('path')