diff --git a/projects/addon-charts/components/line-chart/line-chart.component.ts b/projects/addon-charts/components/line-chart/line-chart.component.ts index a9b159a30c66..56d49523a253 100644 --- a/projects/addon-charts/components/line-chart/line-chart.component.ts +++ b/projects/addon-charts/components/line-chart/line-chart.component.ts @@ -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}`;