Skip to content

Commit 78383b4

Browse files
committed
refactor(charts): remove deprecated method
BREAKING CHANGE: Removed deprecated `SiChartBaseComponent.resetChart` method as it should not be directly used by the consumer.
1 parent 0c68442 commit 78383b4

2 files changed

Lines changed: 1 addition & 30 deletions

File tree

api-goldens/charts-ng/common/index.api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,6 @@ export class SiChartBaseComponent implements AfterViewInit, OnChanges, OnInit, O
258258
readonly pointer: _angular_core.OutputEmitterRef<AxisPointerEvent>;
259259
refreshSeries(isLive?: boolean, dzToSet?: DataZoomRange): void;
260260
readonly renderer: _angular_core.InputSignal<"canvas" | "svg">;
261-
// @deprecated
262-
resetChart(): void;
263261
resize(): void;
264262
readonly selectedItem: _angular_core.InputSignal<SelectedLegendItem>;
265263
readonly selectionChanged: _angular_core.OutputEmitterRef<any>;

projects/charts-ng/common/si-chart-base.component.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ export class SiChartBaseComponent implements AfterViewInit, OnChanges, OnInit, O
390390
this.actualOptions.color = changes.options.previousValue.color;
391391
}
392392
if (changes.theme || changes.renderer) {
393-
// need to completely redo the chart for the theme change to take effect
394-
return this.resetChart();
393+
return this.themeSwitch();
395394
}
396395

397396
let updates = 0;
@@ -615,32 +614,6 @@ export class SiChartBaseComponent implements AfterViewInit, OnChanges, OnInit, O
615614
this.cdRef.markForCheck();
616615
}
617616

618-
/**
619-
* Re-render the whole chart.
620-
* @deprecated The method is deprecated and should not be used directly by the consumer.
621-
*/
622-
resetChart(): void {
623-
this.applyTheme();
624-
625-
if (!this.actualOptions) {
626-
// this can happen if the SiThemeService fires the theme switch when the chart is not
627-
// yet completely initialized
628-
return;
629-
}
630-
631-
this.disposeChart();
632-
this.applyPalette();
633-
const addOpts = this.additionalOptions();
634-
if (addOpts?.palette) {
635-
echarts.util.merge(this.actualOptions.palette, addOpts.palette, true);
636-
}
637-
this.themeChanged();
638-
this.applyStyles();
639-
this.applyTitles();
640-
this.ngAfterViewInit(true); // eslint-disable-line @angular-eslint/no-lifecycle-call
641-
this.cdRef.markForCheck();
642-
}
643-
644617
protected handleLegendClick(legend: CustomLegendItem): void {
645618
this.doToggleSeriesVisibility(legend.name, legend.selected, legend);
646619
this.cdRef.markForCheck();

0 commit comments

Comments
 (0)