# Kibana 8.2.3 "Donut chart can't render with negative values"

**URL:** <https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508>\
**Category:** Kibana\
**Created:** [September 15, 2022, 12:52pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508 "2022-09-15T12:52:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [September 15, 2022, 12:52pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/1 "2022-09-15T12:52:02Z")

</div>

Previously donuts and pies just rendered.  
Now this message is shown when negative values exist on buckets. How can this message be turned off, and thereby achieve the rendering of all buckets which are in fact positive.

- We use aggregation based pies/donuts beacuse of value coloring, so the problem needs a fix within agg. based donuts / pies.
- Therefore we cannot use Lens based, in which the problem can be solved by using "Clamp" in the aggregation

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/9/7938286e5682fc47e966eb7242a1b680729b98eb.png)

---

<div class="post-metadata">

**Author:** ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)\
**Post date:** [September 16, 2022, 8:33am UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/2 "2022-09-16T08:33:04Z")

</div>

Hello There!  
How about showing us your config?

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [September 16, 2022, 9:43am UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/3 "2022-09-16T09:43:18Z")

</div>

Hi there  
Thanks for getting back 😉  
when you say "config" what do exactly mean? The JSON behind the visualization or what?

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [September 19, 2022, 3:37pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/4 "2022-09-19T15:37:29Z")

</div>

Hi Krzysztof  
Did you maybe have any inputs on this?

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 3, 2022, 6:57am UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/5 "2022-10-03T06:57:05Z")

</div>

Hi Krzysztof, any comments on this?

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 3, 2022, 7:02am UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/6 "2022-10-03T07:02:51Z")

</div>

Hi All,  
Is there any way to switch off "Donut chart cant render with negative values"?  
This really breaks any form of user experience...

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [October 3, 2022, 12:24pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/7 "2022-10-03T12:24:17Z")

</div>

@nesretep

can you show us how you've configured the chart in there?  
The error message is reporting the fact that some slices of the donut chart have a negative size, which don't make sense. Do you have an picture of how it was represented this kind of scenario in a previous version to compare?

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 3, 2022, 2:55pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/8 "2022-10-03T14:55:02Z")

</div>

Hi Marco  
Thanks for getting back!  
Well, we have many pies & donuts, and the problem is obviously generic.  
It is true, that the fact of negative buckets in pies/donuts never made sense, and never will. It was just not enforced previously, and is continuously unwanted to be enforced. So, how to disable the ,from my perspective, unwanted behaviour is still my question.  
Idea: You could place an information about negative buckets, but just to place an alarm and not showing anything is not a useable solution in my oppinion.

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 3, 2022, 3:19pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/9 "2022-10-03T15:19:20Z")

</div>

Previous versions did this, which makes sense from a summarization perspective, but the drawing gets "extended" or "skewed" by the negative buckets. This is also how Excel charts work, and like it or not, thats what the world expects 😉

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/2/52b9a2ae0dba017e4464b7b9296fa0d8fcbaf133.png)

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 3, 2022, 8:29pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/10 "2022-10-03T20:29:09Z")

</div>

Here a micro example from Excel:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/d/1da7ab56c14f0a75552527d908752a99bf0233a8.png)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 4, 2022, 12:28am UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/11 "2022-10-04T00:28:12Z")

</div>

Lens Donut Chart with Negative Values...

 ![Screen Shot 2022-10-03 at 5.27.49 PM](https://us1.discourse-cdn.com/elastic/original/3X/5/a/5ab33815bf071f98d5d54a188983c8f6c378da77.jpeg)

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 4, 2022, 1:25pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/12 "2022-10-04T13:25:03Z")

</div>

Hi Stephen,  
Thanks for the example. The buckets are sized by "Count of records", which to my knowledge only can produce 0 or a positive value, so the "-5" in the chart looks like a field value related to the x docs carrying "-5". Therefore the the example, in my optics, does not look like it is relevant to the problem here.  
Assuming that 55 of the 58 docs apply to the chart above, 26 of those docs produce the "-5" bucket, with .45454545454545 of the docs.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 4, 2022, 3:24pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/13 "2022-10-04T15:24:53Z")

</div>

Apologies, Yup Sorry Misread / Mis-saw... and got right back to Donut do not do Negative value! ☹

I tried Lens and Legacy.

You said it worked before do you know which version?

Let me ping internally see if I can get someone from Kibana Viz Team.

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 4, 2022, 5:11pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/14 "2022-10-04T17:11:52Z")

</div>

Hi Stephen

It always worked untill Kibana 8, where negative values apparently suddenly became forbidden. I see the rational og keeping negative values out of pies/donuts, but the enture world lets negative be drawn up with their abs(value). So if anyone would like this to be govenored by “cant render negative values”, then at least, let it be a parameter to switch it on. My guess is that less than 1 out of a 1000 installations, would switch this on.

Vh Lars Peter

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 4, 2022, 5:39pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/15 "2022-10-04T17:39:04Z")

</div>

Did some hacking to get this.... I can show you how ... it works on your simple example but not sure if it would work on something more complex... if D has multi values etc...

I created some runtime fields

 ![Screen Shot 2022-10-04 at 10.37.25 AM](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c70c0856e6a0876185b1586c8d73ad88895305eb.png)

I don't know much about clamping etc ...

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 6, 2022, 2:24pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/16 "2022-10-06T14:24:36Z")

</div>

Looking at your clamp function, it looks like it only can produce a positive value, and that the "-5" still is a field value. On my side _any_ attempt with a negative bucket end with the exclamation.  
Now.. Had the "Size by" actually just affected the Size and not the value of the bucket itself, things would have worked as the rest of the world would expect it to...  
So I think we are back to square 1, where the disabling of the warning is the question, and eventually how negative buckets are drawn up by their abs(value) size?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 6, 2022, 2:38pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/17 "2022-10-06T14:38:19Z")

</div>

I would open a feature request or bug... with as much detail as you can.... best I can offer at this point.

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 11, 2022, 6:37am UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/18 "2022-10-11T06:37:31Z")

</div>

Yes Stephen, I think this calls for a solution where e.g. two modes can be chosen and they could be named:

- Default: Correct value of bucket, but draw buckets by their absolute value (by definition the default expectation in the entire world with correct aggregation but risk of "skewed" drawing)

- Scientific: Forbidden negative buckets (Drawing always accurate sized, but exclamation by negative bucket)

How does that sound?

---

<div class="post-metadata">

**Author:** ![nesretep](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nesretep/32/24743_2.png) [@nesretep](https://discuss.elastic.co/u/nesretep)\
**Post date:** [October 20, 2022, 12:25pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/19 "2022-10-20T12:25:19Z")

</div>

Hi Stephen, Well.. It is not a bug in tecnical perspective, since the system acts as coded. The idea behind the implementation is just so incredibly and utterly bad, from the perspective of the wast majority of users. I would so much like to speak with the people, who considered this to be such a good idea. This harms the world of Kibana users - plain and simple. So not a bug, but a very harmful design flaw. How to address that?

---

<div class="post-metadata">

**Author:** ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)\
**Post date:** [October 20, 2022, 3:41pm UTC](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508/20 "2022-10-20T15:41:26Z")

</div>

Hi @nesretep, please create a detailed enhancement request in the Kibana github repository that includes the alternatives you considered and what works and what doesn't, and please include examples for how the alternatives that you consider good are compatible with the notion of partitioning (which is inherently about the subdivision a whole to its constituents). Please describe why, in the presence of negative numbers, it seems preferable to use a pie/sunburst as opposed to some kind of bar chart. If possible, please describe what you consider a good alternative if there's no current route for the inclusion of negative values in a partition chart. Please link the github issue to this conversation too for referenceability, and the other way around too.

If your support contract includes it, please ask support to link your public github request with you as a customer of Elastic, to increase visibility.

[Next page](https://discuss.elastic.co/t/kibana-8-2-3-donut-chart-cant-render-with-negative-values/314508.md?page=2)
