From e4ec0287e50d97bfb80816e844faf920cb4986da Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Thu, 24 Aug 2017 11:34:59 +0200 Subject: [PATCH] DASH: fix y-axis range and margins: top+bottom --- python_suite/dashboard/static/js/sparkline.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_suite/dashboard/static/js/sparkline.js b/python_suite/dashboard/static/js/sparkline.js index 94cc089..5d180f0 100644 --- a/python_suite/dashboard/static/js/sparkline.js +++ b/python_suite/dashboard/static/js/sparkline.js @@ -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') -- 2.43.0