Skip to content

Commit

Permalink
update legend text y calculation dc-js#1855 & dc-js#1852
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacarar committed Jan 10, 2022
1 parent 0412000 commit 652e1b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/charts/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ export class Legend {
.classed('dc-tabbable', this._keyboardAccessible)
.attr('x', self._itemHeight + LABEL_GAP)
.attr('y', function () {
return self._itemHeight / 2 + (this.clientHeight ? this.clientHeight : 13) / 2 - 2;
const height = this.getBoundingClientRect ? (this.getBoundingClientRect().height) : this.clientHeight
return self._itemHeight / 2 + (height || 13) / 2 - 2;
});

if (this._keyboardAccessible) {
Expand Down

0 comments on commit 652e1b1

Please # to comment.