Skip to content

Commit

Permalink
fix(chart): chart gets cut off on the dashboard (#20315)
Browse files Browse the repository at this point in the history
* fix(chart): chart gets cut off on the dashboard

* add some failsafe

* address comment
  • Loading branch information
stephenLYZ authored Jun 9, 2022
1 parent 354a899 commit 07b4a71
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,14 @@ export default class Chart extends React.Component {
}

getHeaderHeight() {
return (
(this.headerRef && this.headerRef.offsetHeight) || DEFAULT_HEADER_HEIGHT
);
if (this.headerRef) {
const computedStyle = getComputedStyle(this.headerRef).getPropertyValue(
'margin-bottom',
);
const marginBottom = parseInt(computedStyle, 10) || 0;
return this.headerRef.offsetHeight + marginBottom;
}
return DEFAULT_HEADER_HEIGHT;
}

setDescriptionRef(ref) {
Expand Down

0 comments on commit 07b4a71

Please sign in to comment.