Skip to content

Commit e871459

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 06ca45e commit e871459

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
@@ -262,8 +262,6 @@ export class SiChartBaseComponent implements AfterViewInit, OnChanges, OnInit, O
262262
readonly pointer: _angular_core.OutputEmitterRef<AxisPointerEvent>;
263263
refreshSeries(isLive?: boolean, dzToSet?: DataZoomRange): void;
264264
readonly renderer: _angular_core.InputSignal<"canvas" | "svg">;
265-
// @deprecated
266-
resetChart(): void;
267265
resize(): void;
268266
readonly selectedItem: _angular_core.InputSignal<SelectedLegendItem>;
269267
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
@@ -386,8 +386,7 @@ export class SiChartBaseComponent implements AfterViewInit, OnChanges, OnInit, O
386386
this.actualOptions.color = changes.options.previousValue.color;
387387
}
388388
if (changes.theme || changes.renderer) {
389-
// need to completely redo the chart for the theme change to take effect
390-
return this.resetChart();
389+
return this.themeSwitch();
391390
}
392391

393392
let updates = 0;
@@ -612,32 +611,6 @@ export class SiChartBaseComponent implements AfterViewInit, OnChanges, OnInit, O
612611
this.cdRef.markForCheck();
613612
}
614613

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

0 commit comments

Comments
 (0)