# Wrong percent calculation in pie chart | v2

**URL:** <https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599>\
**Category:** Help\
**Created:** [February 14, 2022, 5:17pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599 "2022-02-14T17:17:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viandoriel](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/viandoriel/32/22628_2.png) [@Viandoriel](https://discourse.pi-hole.net/u/Viandoriel)\
**Post date:** [February 14, 2022, 5:17pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/1 "2022-02-14T17:17:53Z")

</div>

**The issue I am facing:**  
Since today's pihole update to the latest version, the pie chart does the same strange things as I already reported some time ago (there it was fixed):

# [Wrong percent calculation in pie chart](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart/44277)

Currently my chart looks like that:

 ![50prozent](https://discourse.pi-hole.net/uploads/default/original/3X/c/1/c10bb8d43c4d991d293627cdccdae8134fcaea40.jpeg)

=\> 34% + 22% = 56% but that's not what the chart is displaying.  
I think others will look nearly the same.  
BTW: the picture is a collage of two pictures to be able to display the original percentage text.

**Details about my system:**  
Pi-hole v5.9  
FTL v5.14  
Web Interface v5.11

[https://tricorder.pi-hole.net/Rfuq5q1z/](https://tricorder.pi-hole.net/Rfuq5q1z/)

**What I have changed since installing Pi-hole:**  
pihole -up 🙂

---

<div class="post-metadata">

**Author:** ![neil62](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/neil62/32/10319_2.png) [@neil62](https://discourse.pi-hole.net/u/neil62)\
**Post date:** [February 15, 2022, 12:02am UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/3 "2022-02-15T00:02:51Z")

</div>

I have also checked/confirm, both the Upstream and Query types pie charts and by using the hover assist to display percentages (to tally a total), and in my case the Query types total is less than 100% and the Upstream percentage exceeds 100% in total.

**Details about my system:**  
Pi-hole v5.9  
FTL v5.14  
Web Interface v5.11

---

<div class="post-metadata">

**Author:** ![Viandoriel](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/viandoriel/32/22628_2.png) [@Viandoriel](https://discourse.pi-hole.net/u/Viandoriel)\
**Post date:** [February 15, 2022, 8:05am UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/4 "2022-02-15T08:05:27Z")

</div>

With me it's only the right one "Upstream servers" which displays the wrong.  
The left Chart "Query Types" looks good and the calculation makes sense.

Maybe it's because the right Chart has something new inside called "Other".  
I have no clue what "Other" would mean. ... doesn't make sense for me.

 ![other](https://discourse.pi-hole.net/uploads/default/original/3X/4/d/4de3e4fa154a2d289ddc2a3682d12098ff80fa39.jpeg)

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [February 15, 2022, 12:44pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/5 "2022-02-15T12:44:09Z")

</div>

Having negative `other` is a bug which is already being fixed. If you want to try this, please run

`pihole checkout ftl fix/negative_others`

To go back on track (and before the next Pi-hole release) please run `pihole checkout master`  
`Other` was introduced by [Add others section to upstream servers pie chart by DL6ER · Pull Request #1284 · pi-hole/FTL · GitHub](https://github.com/pi-hole/FTL/pull/1284). We noticed that the upstream percentage did not sum up to 100% because some queries are neither cached nor blocked nor forwarded

---

<div class="post-metadata">

**Author:** ![Viandoriel](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/viandoriel/32/22628_2.png) [@Viandoriel](https://discourse.pi-hole.net/u/Viandoriel)\
**Post date:** [February 15, 2022, 1:49pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/6 "2022-02-15T13:49:00Z")

</div>

> [@Viandoriel](#):
>
> =\> 34% + 22% = 56% but that's not what the chart is displaying.

ok, makes sense, but the displayed chart does not make sense:  
=\> 34% + 22% = 56% =\> so the Chart should be filled by more than half (\>50%). But it's more like 1/4

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [February 15, 2022, 3:36pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/7 "2022-02-15T15:36:29Z")

</div>

Is the chart also broken on the special branch?

---

<div class="post-metadata">

**Author:** ![neil62](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/neil62/32/10319_2.png) [@neil62](https://discourse.pi-hole.net/u/neil62)\
**Post date:** [February 15, 2022, 11:43pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/9 "2022-02-15T23:43:48Z")

</div>

Hi, I have just checked the chart after switching to the pihole checkout ftl fix/negative\_others and all looks good to me now, i.e. numbers now tallying 100%

---

<div class="post-metadata">

**Author:** ![Viandoriel](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/viandoriel/32/22628_2.png) [@Viandoriel](https://discourse.pi-hole.net/u/Viandoriel)\
**Post date:** [February 17, 2022, 8:39am UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/10 "2022-02-17T08:39:34Z")

</div>

thanks for help/testing! 🙂

@yubiuser: is there anywhere an explanaition what "other" means?  
I don't understand what this should be, as all other points mean (in my understanding) that there is some request forwarded to "xyz". But other?! What is other?  
In my current view I have about "-70%" other. In reality it looks (I mean optical, in the chart) like 1/4 of the chart. So in my perspective it's a really huge amount.

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [February 17, 2022, 12:04pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/11 "2022-02-17T12:04:41Z")

</div>

> [@Viandoriel](#):
>
> In my current view I have about "-70%" other. In reality it looks (I mean optical, in the chart) like 1/4 of the chart. So in my perspective it's a really huge amount.

Is this with the special branch? If not the numbers and the chart are not reliable.. There should only be a small amount of `other`. Others are, for examples, queries which have been already forwarded and for which Pi-hole is still waiting for an answer while the client is making the same query again.

---

<div class="post-metadata">

**Author:** ![Viandoriel](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/viandoriel/32/22628_2.png) [@Viandoriel](https://discourse.pi-hole.net/u/Viandoriel)\
**Post date:** [February 17, 2022, 3:05pm UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/12 "2022-02-17T15:05:07Z")

</div>

nope, to be honest I was a little bit affraid to "destroy" something.

Thanks for explanation... will see if this will stay the same after the next update.  
But I assume it will, becasue if I click on it I get a huuuuge list of entries.  
I have 100 each 3 minutes!

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [February 18, 2022, 11:51am UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/13 "2022-02-18T11:51:20Z")

</div>

Bug fix is being tracked here

> <https://github.com/pi-hole/FTL/pull/1305>
>
> \*\*By submitting this pull request, I confirm the following:\*\*
> 
> \- \[X\] I have re…ad and understood the \[contributors guide\](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
> \- \[X\] I have checked that \[another pull request\](https://github.com/pi-hole/FTL/pulls) for this purpose does not exist.
> \- \[X\] I have considered, and confirmed that this submission will be valuable to others.
> \- \[X\] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
> \- \[X\] I give this submission freely, and claim no ownership to its content.
> 
> \*\*How familiar are you with the codebase?:\*\* 
> 
> \## 10
> 
> \---
> 
> Fix the reference using in the \`Upstream Servers\` pie chart. This chart shows how many queries are being sent to the respective destinations. We recently introduced a special category "other" that summarizes everything which does not fall into one of the available categories (like local SERVFAIL). The bug is that we have recently seen reports for \*negative\* other shares. This is caused by a wrong reference being used. As Pi-hole is periodically sending one and the same query to multiple upstream servers to probe which one is the fastest. This may cause five queries for only one "real" query. You see where this is leading...
> 
> The bugfix simply changes the reference frame from "how many queries we know" to "how many queries we sent". We leave a comment about this in the code for future reference.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [March 11, 2022, 11:51am UTC](https://discourse.pi-hole.net/t/wrong-percent-calculation-in-pie-chart-v2/53599/14 "2022-03-11T11:51:46Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
