diff --git a/src/chart/scatter/ScatterView.ts b/src/chart/scatter/ScatterView.ts index 972c36e4cb..1f5d6ede49 100644 --- a/src/chart/scatter/ScatterView.ts +++ b/src/chart/scatter/ScatterView.ts @@ -29,6 +29,7 @@ import SeriesData from '../../data/SeriesData'; import { TaskProgressParams } from '../../core/task'; import type { StageHandlerProgressExecutor } from '../../util/types'; import Element from 'zrender/src/Element'; +import { createClipPath } from '../helper/createClipPathFromCoordSys'; class ScatterView extends ChartView { static readonly type = 'scatter'; @@ -53,6 +54,12 @@ class ScatterView extends ChartView { clipShape: this._getClipShape(seriesModel) }); + // Apply visual clipping to prevent symbols from overflowing + const clipPath = seriesModel.get('clip', true) + ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) + : null; + this.group.setClipPath(clipPath); + this._finished = true; } diff --git a/test/scatter-datazoom-filtermode-none-time-axis.html b/test/scatter-datazoom-filtermode-none-time-axis.html new file mode 100644 index 0000000000..e9d1d63dd4 --- /dev/null +++ b/test/scatter-datazoom-filtermode-none-time-axis.html @@ -0,0 +1,475 @@ + + + + + + + + + + + + Issue #19972: Scatter + Time Axis + DataZoom filterMode: none + + + +
+

Issue #19972: Scatter Chart points overflow out of the coordinate system

+

Scenario: filterMode: 'none' + series type: scatter + x-axis type: time

+

Problem: On zooming in too much, the scatter points would go outside of the graph (beyond axis)

+

Expected: Scatter points should be clipped at the coordinate system boundary when clip: true

+

Test: Use the slider or mouse wheel to zoom in. Points at the edges should be clipped, not overflow.

+
+ + +
+ + + +
+ + + +
+ + + +
+ + + +