Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
23 changes: 11 additions & 12 deletions packages/vchart/src/series/box-plot/box-plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> ex
getOutliersStyle() {
return this._outliersStyle;
}
protected _outlierDataView: ICompilableData;
protected _outlierData: ICompilableData;

private _autoBoxWidth: number;

Expand Down Expand Up @@ -140,10 +140,10 @@ export class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> 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);
}
}

Expand Down Expand Up @@ -324,12 +324,17 @@ export class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> 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 {
Expand Down Expand Up @@ -476,12 +481,6 @@ export class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> ex
return fields;
}

onEvaluateEnd(ctx: IModelEvaluateOption): void {
//初次编译时,会传入空数据;待所有计算完成后,需要重新执行updateData更新数据
super.onEvaluateEnd(ctx);
this._outlierDataView.updateData();
}

getDefaultShapeType(): string {
return 'square';
}
Expand Down
Loading