Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing the order of the items in legend of a chart

I have a stacked bar chart with different stages grouped by color and a legend next to it.

The order of these stages are in a wrong order in legend; starting from top with 5 and 4, 2, 3, 1. How can I make it so that it's in an ascending order like 1, 2, 3, 4, 5?

Thank you!

16 Replies
Rajamohan
Contributor III
Contributor III

Try to collapse the arrow the move 'Stage' upto the 'Month...

Not applicable
Author

Hello,

Attached the modified qvf file.

Thanks for your help!

robert_mika
Master III
Master III

Create new Dimension:

if(Stage='3_PPP',Dual('1.PPP',1),

if(Stage='2_FP',Dual('4.FP',5),

if(Stage='1_ID',Dual('5.ID',4),

if(Stage='4_R/N',Dual('3.R/N',3)

,if(Stage='5_ Final',Dual('2.Final',2))))))

And ad it instead of the Stage one.

Not applicable
Author

Hi Robert,

It finally worked! Thank you so much! I am not sure how you were able to achieve this though; what is the Dual for?

robert_mika
Master III
Master III

Not applicable
Author

After checking through, I realized that different stages refer to different stages now. So the change made above didn't really change the order but just the texts. So if I click on stage 5, the graph shows stage 1. Are there alternatives?

robert_mika
Master III
Master III

Your first bars starts from PPP  (3) which specify the sort.

Bear in mind that 1,2,3 are not number but a part of the string.

You may try to play with your data to separate the number from the stage level at script level..