question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Add clip option for scatter, line, bar, lines, custom chart

See original GitHub issue

Currently 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:open
  • Created 4 years ago
  • Reactions:4
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Oviliacommented, Sep 16, 2019

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. image 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.

2reactions
Oviliacommented, Sep 16, 2019

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? image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found