Assign colors to boolean pie chart

I want to have fixed colors for true/false. At the moment, the color palette simply assigns the bigger value to the default color which makes it hard to tell in one glance if the piechart is mostly false or true:
I already found this thread here while searching for this issue: Pie chart colors change
But I can't seem to use the canvas to solve this problem. Is it because of the datatype?

Hi @kequach ,

welcome to the Kibana community.

If you're only concern is about color consistency for boolean values, I can suggest the filters workaround:

  • Instead of Top Value/Terms use a Filters aggregation
  • Reorder the filters in the same order for all pies

The configuration above was made in Lens editor: palette colors will be assigned in order of filters which can be useful for consistency.

1 Like

Hi @Marco_Liberati ,

thanks for the response. I tested the filter solution but the visualizations don't change:

In the following screenshot I changed the order of the filters:

This is also visible in your screenshot. I would expect true to be the green color, as it is first in order. However, for your example, it is also the larger group (false) that is green. It functions the same way the "Top values" works.

Hey @kequach, this is a feature that we are planning to add in Lens soonish :slight_smile:
For now, you could also use the aggregation-based visualizations.

If you click on the legend item there is a color picker with a set of colors that you could use for true/false.


Oh right, sorry. Partition charts like Pie or Treemap enforce a sorting of the slices no matter the filters. Other types of charts will respect the filters order.

1 Like

Thanks! It's a bit annoying to do it for every piechart (there are around 10 of them in total) but at least this works now.

Yes we know :slight_smile: But we are working on making it work more effectively in Lens!

1 Like

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