How do I create a rank to dynamically control my bar chart?

We can use the group/colour settings and set the no. of bar segments displayed as 5. Check here for sample implementation.
Just a catch, instead of adding the direct field value, create a calculated field sum(value) that will allow you to sort the value field correctly. Here is a snip to the implementation, details you can check in the same published analysis sample solution 46922

1 Like