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

Pie chart are not clickable with large segment #118

Open
messenger63 opened this issue Apr 27, 2023 · 1 comment
Open

Pie chart are not clickable with large segment #118

messenger63 opened this issue Apr 27, 2023 · 1 comment

Comments

@messenger63
Copy link

messenger63 commented Apr 27, 2023

Hi, there is issue with Pie Chart.
Steps to reproduce:

  • open sample app;
  • set segments, like 8, 1, 1;
  • run app, click on small segment, then click on large segment at 0 degree (at the beginning of segment on the screen);
    Results: clicks are not working, there is some issue in segment calculation.

Seems like this issue happens when you have large segment, single segment more than 180deg, then part of that segment at the beginning are not clickable.

Please, reply if this issue could be fixed in near future.

@messenger63
Copy link
Author

messenger63 commented Apr 27, 2023

The issue is in calculating dist at PieRenderer.getContainingSegment()
Probably it should be something like this:

double dist = signedDistance(offset, angle);
double endDist = signedDistance(offset, lastOffset);
if (dist < 0) { // added
dist = FULL_PIE_DEGS + dist; // added
} // added

if(endDist < 0) {
// segment accounts for more than 50% of the pie and wrapped around
// need to correct:
endDist = FULL_PIE_DEGS + endDist;
}
Or some fix for signedDistance() method calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant