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

Don't show detailed doughnut tooltip if sum is > 99.9% #2398

Merged
merged 4 commits into from Oct 16, 2022
Merged

Don't show detailed doughnut tooltip if sum is > 99.9% #2398

merged 4 commits into from Oct 16, 2022

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Oct 13, 2022

What does this PR aim to accomplish?:

To decide whether some slice of the doughnut chart is hidden, we use .chart._metasets[0].total which outputs the percentage of "total shown percent". If it was >=100 we did not show the detailed doughnut tooltip.

However, even if no slice is hidden .chart._metasets[0].total returns percentages between 100.000000001 and 99.9799999, in the latter case the detailed tooltip is shown despite nothing is hidden.
To compensate the rounding issue, this PR won't show the detailed tooltip if percentage is > 99.9.

Before:
Screenshot at 2022-10-13 09-15-37

After:
Screenshot at 2022-10-13 09-28-10


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser added the PR: Approval Required Open Pull Request, needs approval label Oct 13, 2022
@yubiuser yubiuser requested a review from a team October 13, 2022 07:38
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser changed the title Don't show detailed doughnut tooltip if sum is 99.99% Don't show detailed doughnut tooltip if sum is > 99.9% Oct 13, 2022
@yubiuser
Copy link
Member Author

Added a commit that will show if item percentage of total share is less then 0.1% with <0.1% instead of 0.0% as we have it now.

Signed-off-by: Christian König <ckoenig@posteo.de>
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/up-to-date-documentation/58566/2

@yubiuser yubiuser merged commit 42c6039 into devel Oct 16, 2022
@yubiuser yubiuser deleted the 99 branch October 16, 2022 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Approval Required Open Pull Request, needs approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants