Skip to content

Commit de5c56c

Browse files
committed
replacing axes padding with svg padding to prevent 0 from being displayed with a bar
1 parent 84c4520 commit de5c56c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/card/report/NeoBarChartReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class NeoBarChartReport extends NeoReport {
4949
xShift += (maxY < 0 || minY < 0) ? 10 : 0;
5050
var yShift = 20 + xTextLength * 4;
5151
var width = props.clientWidth - 100; //-90 + props.width * 105 - xShift * 0.5;
52-
var height = -140 + props.height * 100 - yShift;
53-
var margin = {top: 0, right: 0, bottom: yShift, left: xShift};
52+
var height = -160 + props.height * 100 - yShift
53+
var margin = {top: 10, right: 0, bottom: yShift, left: xShift};
5454

5555
var svg = d3.select(".chart" + id)
5656
.attr("width", width + margin.left + margin.right)
@@ -74,7 +74,7 @@ class NeoBarChartReport extends NeoReport {
7474
.style("text-anchor", "end");
7575

7676
var y = d3.scaleLinear()
77-
.domain([minY - (maxY - minY) * 0.1, maxY + (maxY - minY) * 0.1])
77+
.domain([minY, maxY])
7878
.range([height, 0]);
7979
svg.append("g")
8080
.call(d3.axisLeft(y));

0 commit comments

Comments
 (0)