diff --git a/timeline-chart/src/layer/time-graph-chart.ts b/timeline-chart/src/layer/time-graph-chart.ts index be8c473..f37a2f6 100644 --- a/timeline-chart/src/layer/time-graph-chart.ts +++ b/timeline-chart/src/layer/time-graph-chart.ts @@ -41,7 +41,6 @@ export class TimeGraphChart extends TimeGraphChartLayer { protected rowElementMouseInteractions: TimeGraphRowElementMouseInteractions; protected selectedElementModel: TimelineChart.TimeGraphState; protected selectedElementChangedHandler: ((el: TimelineChart.TimeGraphState) => void)[] = []; - protected providedRange: TimelineChart.TimeGraphRange; protected providedResolution: number; @@ -172,14 +171,16 @@ export class TimeGraphChart extends TimeGraphChartLayer { this.maybeFetchNewData(); } }); - if (this.unitController.viewRangeLength) { + if (this.unitController.viewRangeLength && this.stateController.canvasDisplayWidth) { this.maybeFetchNewData(); } } updateChart() { const update = true; - this.maybeFetchNewData(update); + if (this.unitController && this.stateController) { + this.maybeFetchNewData(update); + } } update() {