[feature] Add clip option for scatter, line, bar, lines, custom chart
See original GitHub issueCurrently we have overflow issue on the axis with fixed min/max. As described in the following issues.
- #11086 Bug with stack bar with min value
- #9200 Incorrectly render lines overflow the chart
- #10010 Scatters are rendered outside of grid when setting axis range
- #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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:14 (9 by maintainers)
Top Results From Across the Web
[feature] Add clip option for scatter, line, bar, lines, custom ...
So I'm planning to add a clip option in these series, whose default value is true. The clipping strategy varies between series to...
Read more >Change data markers in a line, scatter, or radar chart
Tip: To fill a data marker with a picture, click Picture or texture fill, and then under Insert from, click File, Clipboard (if...
Read more >Customizing Visualizations — Altair 4.2.0 documentation
“Encoding” channels can also be used to set some chart properties ... One option is to “clip” the data by setting the "clip"...
Read more >10 Chart.js example charts to get you started - Tobias Ahlin
A list of 10 graphs (bar chart, pie, line, etc.) with data set up to render charts that you can copy and paste...
Read more >How to add custom lines and areas in scatterplots
In the last panel of the Annotate tab in step 3: Visualize, we can add extra lines and areas to our scatterplots. That's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For example, if I wish to keep my grid area clean and do not want anything to overflow from it, or if there is axis tick label on the left side and I don’t want the circle to overflow from the grid to touch the axis label. In this case, neither of the situations when the circle is on the top of the axis label or under it creates a satisfying result.
This is just one example. What I wish to say is that it is important (to provide the ability) to keep the series inside the grid area to avoid unexpected results.
I’m cool with most of these. Just to be clarified, what happens to scatter items whose centroid is inside the grid but part of the circle is outside the grid area? I think (A) displaying the whole graphic and (B) displaying the part inside the grid both make sense. Would it be possible for a user to decide which policy to use?