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

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


Hello There!
How about showing us your config?

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

Hi Krzysztof
Did you maybe have any inputs on this?

Hi Krzysztof, any comments on this?

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


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?

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.

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 :wink:

Here a micro example from Excel:

Lens Donut Chart with Negative Values...

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.

1 Like

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

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.

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

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

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

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?

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

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?

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?

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.