Search code examples
bar-chartspotfiretibcostackedstackedbarseries

Spotfire - Show top values in stacked bar chart


I have a stacked bar chart that looks like this :

Example of data

I would like to only show the top 3 bars in terms of value, that is to say the three first bars. I tried to use the Show/Hide feature but it doesn't work as I expected.

For example if I limit to Show top 1 value with the Show/Hide value, i get :

Bug example

when I expect to also have the orange and blue bars that are stacked in the first picture.

Is there a way to do what I am looking for?


Solution

  • I found a better way to do this :

    Using the Show/Hide rules of the properties of the visualization, you have to add this rule

    DenseRank(Sum([Value]) over (All([Axis.Color])),"desc") <= 3
    

    Then you have to [Axis.Value] in the value input.


    3 is the number of bars to have in the bar chart.

    [Value] is the column of the Y Axis, in my case I used Count() because my Y axis is (Row Count).


    You can find more info at this link : https://community.tibco.com/questions/question-showhide-top-10