hide empty segment in a donut chart

  • 1
  • Question
  • Updated 3 years ago
Hello,

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

 





Thx
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Dave,

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

  • 12,436 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.

https://community.skuidify.com/skuid/topics/filter_on_count