Skip to content

Commit 5aded4d

Browse files
committed
refactor(chart): fix default chart instance reference issue
1 parent 507eb8b commit 5aded4d

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

frontend/src/app/components/ChartGraph/BasicTableChart/BasicTableChart.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class BasicTableChart extends ReactChart {
9090
options.config,
9191
options.widgetSpecialConfig,
9292
);
93-
this.cachedAntTableOptions = Omit(tableOptions, ['dataSource']);
93+
// this.cachedAntTableOptions = Omit(tableOptions, ['dataSource']);
94+
this.cachedAntTableOptions = Omit(tableOptions, []);
9495
this.cachedDatartConfig = options.config;
9596
this.cacheContext = context;
9697
this.adapter?.updated(tableOptions, context);
@@ -107,14 +108,6 @@ class BasicTableChart extends ReactChart {
107108

108109
public onResize(options, context?): void {
109110
const columns = this.getDataColumnWidths(options, context);
110-
const dataConfigs = options.config.datas || [];
111-
const chartDataSet = transformToDataSet(
112-
options.dataset.rows,
113-
options.dataset.columns,
114-
dataConfigs,
115-
);
116-
this.cachedAntTableOptions.dataSource = chartDataSet;
117-
118111
const tableOptions = Object.assign(
119112
this.cachedAntTableOptions,
120113
{

frontend/src/app/pages/ChartWorkbenchPage/models/ChartManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ChartManager {
8484
}
8585

8686
public getDefaultChart() {
87-
return this._charts[0];
87+
return CloneValueDeep(this._charts[0]);
8888
}
8989

9090
private async _loadCustomizeCharts(paths: string[]) {

0 commit comments

Comments
 (0)