Skip to content

Commit

Permalink
original fix by @AntonPOD, see #2
Browse files Browse the repository at this point in the history
("added a condition which prevents adding height more than once")
  • Loading branch information
theKeithD authored and TorsteinHonsi committed Oct 29, 2018
1 parent d2ce985 commit e90741f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adapt-chart-to-legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
addedHeight = Math.max(this.group.translateY + this.legendHeight - chart.originalChartHeight, 0);

// Move the legend down
} else if (this.options.verticalAlign === 'bottom') {
} else if (!chart.container.attributes['height-adapted-to-legend'] && this.options.verticalAlign === 'bottom') { // #2
translateY = this.group.attr('translateY') + this.legendHeight;
this.group.attr('translateY', translateY);

chart.container.setAttribute('height-adapted-to-legend', true); // #2

if (this.group.alignAttr) {
this.group.alignAttr.translateY = translateY;
}
Expand Down

0 comments on commit e90741f

Please sign in to comment.