hide empty segment in a donut chart

  • 1
  • Question
  • Updated 4 years ago

Anyone would know of a way to hide segments (category) in a donut chart when there are equal to 0 ?

In the example below, i would like to be able to only see the 2 categories >0 (red and orange one) the other 4 should not even show at all


Photo of Dave


  • 6,442 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of J.

J., Official Rep

  • 7,846 Points 5k badge 2x thumb

The short answer is that Charts show whatever is in your model data, so if it's in the model, even with a zero value, it'll still show. The only way to get rid of them without writing some code at this point is to not have them included in your model. If that's not an option, you can use a Before Render Snippet (see this and this for some good community resources) to remove the series that you don't want shown. 
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,522 Points 10k badge 2x thumb
Dave would a 'having' condition work for you?  You could filter for results greater than zero.  Here is  a link on how to do this.