Skip to content
Merged
11 changes: 5 additions & 6 deletions src/traces/bar/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,13 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
);

// display zeros if line.width > 0
if(isBlank && shouldDisplayZeros && helpers.getLineWidth(trace, di) && (isHorizontal ? x1 - x0 === 0 : y1 - y0 === 0)) {
if(isBlank && shouldDisplayZeros &&
helpers.getLineWidth(trace, di) &&
(isHorizontal ? x0 === x1 : y0 === y1)) {
isBlank = false;
}
di.isBlank = isBlank;

if(isBlank && isHorizontal) x1 = x0;
if(isBlank && !isHorizontal) y1 = y0;

// in waterfall mode `between` we need to adjust bar end points to match the connector width
if(adjustPixel && !isBlank) {
if(isHorizontal) {
Expand All @@ -182,9 +181,9 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
mc = di.mc || trace.marker.color;
}

var offset = d3.round((lw / 2) % 1, 2);

function roundWithLine(v) {
var offset = d3.round((lw / 2) % 1, 2);

// if there are explicit gaps, don't round,
// it can make the gaps look crappy
return (opts.gap === 0 && opts.groupgap === 0) ?
Expand Down