-
Notifications
You must be signed in to change notification settings - Fork 19.8k
[feature] Add clip option for scatter, line, bar, lines, custom chart #11240
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
new-featurestaleInactive for a long time. Will be closed in 7 days.Inactive for a long time. Will be closed in 7 days.waiting-for: community
Description
Currently we have overflow issue on the axis with fixed min/max. As described in the following issues.
- Bug with stack bar with min value #11086 Bug with stack bar with min value
- Incorrectly render lines overflow the chart. #9200 Incorrectly render lines overflow the chart
- Scatters are rendered outside of grid when setting axis range #10010 Scatters are rendered outside of grid when setting axis range
- Toolbox zoom returns chart in odd state #10224 Toolbox zoom returns chart in odd state
They are all related to the function of clipping the overflowed graphics.
So I'm planning to add a clip option in these series, whose default value is true.
The clipping strategy varies between series to achieve a good visual quality. For example:
- Scatter series will ignore the graphics whose centroid is outside the grid.
- Line series will use a rect clip path and let canvas do the clipping. But the symbol in line series will follow scatter series.
- Bar series will do an intersection operation with the grid rect.
- Custom series will also use a clip path to do the clipping. Since we can't sure what graphics will be used.
Series needs clip option
- scatter
- line
- bar
- pictorialBar
- lines
- candlestick
- custom
Q: Why not use clip path for all series?
A: Let canvas do clipping may cause visual artifacts on particular series. For example:
- It may cut the graphics into half.
- It may cause line along the edge looks thinner
Reference of highcharts. https://api.highcharts.com/highcharts/series.line.clip
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
new-featurestaleInactive for a long time. Will be closed in 7 days.Inactive for a long time. Will be closed in 7 days.waiting-for: community