Skip to content

Commit

Permalink
correct initial visibility of hidden bars (#2702)
Browse files Browse the repository at this point in the history
When using 'data_hide' option, the bars are not taken into account when
computing offsets and so on but they still have 'opacity:1'.
  • Loading branch information
panthony authored and kt3k committed Sep 23, 2019
1 parent 0d156f8 commit 391897d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shape.bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ ChartInternal.prototype.updateBar = function (durationForExit) {
.style("opacity", 0);
};
ChartInternal.prototype.redrawBar = function (drawBar, withTransition, transition) {
const $$ = this;

return [
(withTransition ? this.mainBar.transition(transition) : this.mainBar)
.attr('d', drawBar)
.style("stroke", this.color)
.style("fill", this.color)
.style("opacity", 1)
.style("opacity", (d) => $$.isTargetToShow(d.id) ? 1 : 0)
];
};
ChartInternal.prototype.getBarW = function (axis, barTargetsNum) {
Expand Down

0 comments on commit 391897d

Please sign in to comment.