diff --git a/common/changes/@visactor/vchart/fix-boxPlot-outlier-style_2025-12-11-08-41.json b/common/changes/@visactor/vchart/fix-boxPlot-outlier-style_2025-12-11-08-41.json new file mode 100644 index 0000000000..43b969ec2a --- /dev/null +++ b/common/changes/@visactor/vchart/fix-boxPlot-outlier-style_2025-12-11-08-41.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: update outlier data handling in BoxPlotSeries, fix #4317\n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/packages/vchart/src/series/box-plot/box-plot.ts b/packages/vchart/src/series/box-plot/box-plot.ts index 310581ea52..a5c6167060 100644 --- a/packages/vchart/src/series/box-plot/box-plot.ts +++ b/packages/vchart/src/series/box-plot/box-plot.ts @@ -100,7 +100,7 @@ export class BoxPlotSeries ex getOutliersStyle() { return this._outliersStyle; } - protected _outlierDataView: ICompilableData; + protected _outlierData: ICompilableData; private _autoBoxWidth: number; @@ -140,10 +140,10 @@ export class BoxPlotSeries ex if (this._outliersField) { this._outlierMark = this._createMark(BoxPlotSeries.mark.outlier, { key: DEFAULT_DATA_INDEX, - groupKey: this._seriesField, - dataView: this._outlierDataView.getDataView(), - dataProductId: this._outlierDataView.getProductId() + groupKey: this._seriesField }) as ISymbolMark; + + this._outlierMark.setData(this._outlierData); } } @@ -324,12 +324,17 @@ export class BoxPlotSeries ex false ); - this._outlierDataView = new CompilableData(this._option, outlierDataView); + this._outlierData = new CompilableData(this._option, outlierDataView); } compileData() { super.compileData(); - this._outlierDataView?.compile(); + this._outlierData?.compile(); + } + + viewDataUpdate(d: DataView): void { + super.viewDataUpdate(d); + this._outlierData?.updateData(); } init(option: IModelInitOption): void { @@ -476,12 +481,6 @@ export class BoxPlotSeries ex return fields; } - onEvaluateEnd(ctx: IModelEvaluateOption): void { - //初次编译时,会传入空数据;待所有计算完成后,需要重新执行updateData更新数据 - super.onEvaluateEnd(ctx); - this._outlierDataView.updateData(); - } - getDefaultShapeType(): string { return 'square'; }