Prevent -1 dimension errors in LineChart

This commit is contained in:
Michael Lange 2021-02-24 19:28:14 -08:00
parent 7e4ecd5955
commit 9095b7b81e

View file

@ -209,11 +209,11 @@ export default class LineChart extends Component {
}
get xAxisOffset() {
return this.height - this.xAxisHeight;
return Math.max(0, this.height - this.xAxisHeight);
}
get yAxisOffset() {
return this.width - this.yAxisWidth;
return Math.max(0, this.width - this.yAxisWidth);
}
@action