Skip to content

Commit

Permalink
fix(addon-charts): fix division by zero in LineChart (#9722)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonenkof authored Nov 11, 2024
1 parent 770917e commit c12a315
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class TuiLineChart implements OnChanges {
protected readonly hintDirective = inject(TuiLineChartHint, {optional: true});
protected readonly hintOptions = inject(TuiHintOptionsDirective, {optional: true});
protected readonly viewBox = computed(() => {
const offset = this.height / this.resize();
const offset = this.height / Math.max(this.resize(), 1);
const [x = 0, y = 0, width = 0, height = 0] = this.box().split(' ').map(Number);

return `${x} ${y - offset} ${width} ${height + 2 * offset}`;
Expand Down

0 comments on commit c12a315

Please sign in to comment.