From 758d62b3c281c790423f03b114523d85181cad53 Mon Sep 17 00:00:00 2001 From: tylercchase Date: Mon, 2 Dec 2024 12:52:00 -0500 Subject: [PATCH] fix: refresh baseline reference if series removed --- .../timeseries-chart/timeseries-chart.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/components/timeseries-chart/timeseries-chart.component.ts b/src/app/components/timeseries-chart/timeseries-chart.component.ts index 75cbc6a8b..1ecc424cb 100644 --- a/src/app/components/timeseries-chart/timeseries-chart.component.ts +++ b/src/app/components/timeseries-chart/timeseries-chart.component.ts @@ -222,6 +222,14 @@ export class TimeseriesChartComponent implements OnInit, OnDestroy { const allPointsData: { point: {}, state: models.timeseriesChartItemState }[] = Object.keys(chartStates).map( wkt => ({ point: cache[wkt], state: chartStates[wkt] }) ); + if(this.baseData) { + const missingBaseSeries = Object.keys(chartStates).findIndex( + wkt => {return chartStates[wkt].seriesNumber === this.baseData.seriesNumber}); + console.log(missingBaseSeries) + if(missingBaseSeries === -1) { + this.baseData = null; + } + } this.data = allPointsData; this.formulaOverflow = this.isOverflowing(); this.initChart(this.data)