Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to clip the data point along with radius. #897

Closed
prajwal27 opened this issue Feb 10, 2022 · 1 comment
Closed

Feature to clip the data point along with radius. #897

prajwal27 opened this issue Feb 10, 2022 · 1 comment
Labels
enhancement New feature or request Scatter Chart

Comments

@prajwal27
Copy link
Contributor

Describe the bug
The Scatter chart in the image below does not clip the bubble.It considers only the data points. The ScatterChartData has a attribute called clipData , which checks if the data point is within the chart and then decides to clip it or not.
However, it doesn't consider the radius of the bubble and hence, even if the data point is inside, the bubble might be so big that it causes it to go outside the axis, which is not a good UI/UX.

To Reproduce
It is fairly easy to reproduce. Take any example of scatter chart and increase the radius until you see it cross the axis.

Screenshots
image

Possible Solution
So, currently we have clipped the bubble (see the topmost bubble), and it doesn't cross the chart, but it does cross the axis. So, what I feel would be a better idea is to crop clip the bubble inside the chart. So, we get something like this
image
Here, the bubble doesn't cross the axis.

Versions

  • Flutter version: 2.10.0
  • fl_chart version: 0.41.0
@imaNNeo imaNNeo added enhancement New feature or request Scatter Chart labels Feb 10, 2022
prajwal27 pushed a commit to prajwal27/fl_chart that referenced this issue Feb 11, 2022
imaNNeo pushed a commit that referenced this issue Feb 11, 2022
* feat: Introduce 'clipBubble' attribute to scatter chart.

* fix: remove `clipBubble` attribute and implement `clipData` function in scatter chart.

* added issue fix #897 to changelog.

* modify clip equation to resolve border issue.

Co-authored-by: prajwal27wiijii <prajwal@wiijii.co>
@imaNNeo
Copy link
Owner

imaNNeo commented Feb 12, 2022

It has been fixed in 0.45.0 with your help :))
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Scatter Chart
Projects
None yet
Development

No branches or pull requests

2 participants