Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c71ca70

Browse files
committed
should not force x1=x0 and y1=y0
1 parent 4972429 commit c71ca70

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/traces/bar/plot.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,13 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
149149
);
150150

151151
// display zeros if line.width > 0
152-
if(isBlank && shouldDisplayZeros && helpers.getLineWidth(trace, di) && (isHorizontal ? x1 - x0 === 0 : y1 - y0 === 0)) {
152+
if(isBlank && shouldDisplayZeros &&
153+
helpers.getLineWidth(trace, di) &&
154+
(isHorizontal ? x0 === x1 : y0 === y1)) {
153155
isBlank = false;
154156
}
155157
di.isBlank = isBlank;
156158

157-
if(isBlank && isHorizontal) x1 = x0;
158-
if(isBlank && !isHorizontal) y1 = y0;
159-
160159
// in waterfall mode `between` we need to adjust bar end points to match the connector width
161160
if(adjustPixel && !isBlank) {
162161
if(isHorizontal) {
@@ -182,9 +181,9 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
182181
mc = di.mc || trace.marker.color;
183182
}
184183

185-
var offset = d3.round((lw / 2) % 1, 2);
186-
187184
function roundWithLine(v) {
185+
var offset = d3.round((lw / 2) % 1, 2);
186+
188187
// if there are explicit gaps, don't round,
189188
// it can make the gaps look crappy
190189
return (opts.gap === 0 && opts.groupgap === 0) ?

0 commit comments

Comments
 (0)