Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reordering the legend

Is there a way to reverse the order of the legend on a bar chart? When using Stacked bars, my boss would like it to follow the same Top Down order of the stack. I'm using Sense Desktop.

Thanks

19 Replies
Not applicable
Author

Ok, so after working on this, I came to the conclusion that my question is not being understood. The two images below are from Qlik View and Qlik Sense. The one from View has the legend sorted correctly. The one from Sense is reversed. How can I get Sense to sort like View?

qlik.jpg

Anonymous
Not applicable
Author

I understand your question and as I replied earlier :

No can do, out of the box, as far as I am aware.

You could write an extension, but unless you have extension writing skills that may not be a viable option.  Not aware of any suitable open source extensions but worthwhile checking out Qlik Branch

Not applicable
Author

Yes, you absolutely did. Sorry I was overly general in my statement. My clarification post was meant for those that were trying to help but may not have understand what my end goal was.

Anonymous
Not applicable
Author

No worries.

If somebody does have a cunning [non extension] solution then I would would love to know the answer as well as you.

Anonymous
Not applicable
Author

Jim,

What is your current setting in the Sorting properties that is giving you the current sequence of Fixed, Variable, Profit in the legend? It appears to me that it is load order (i.e. Auto sorting is disabled but no specific sorting option is selected).

The attached is my current setting and it matches the sequence of bars and the way the legend shows up. legend-sort.JPG

Can you share your settings?

Thanks,

Ajit

Not applicable
Author

Hi Ajit,

Can you set your chart to Stacked and move the legend to either side (not on top), then I think you'll see what I see with the legend being reversed from the stack.

But as for you question, I have a measure for Fixed, and one for Variable, and one for Profit. All are set to Auto. The current sort order is being determined by their position in the Measures list.

2017-03-08_16-37-07.jpg

Thanks,

Jim

priyasawant
Creator II
Creator II

Hi

Anonymous
Not applicable
Author

Hi Jim,

I have to agree with Priyanka and Bill, it looks like the default setting. Look at some of these threads as well -

Re: Qlik Sense - sort legend in stacked bar chart

Qlik Sense - Problem sorting legend

you can't add a data island based dimension as you can't have 3 dimensions in the stacked bar chart, nor can you have a blank measure added. I tried WildMatch in the sort by expression but the first and last values are always reversing... ! I hate to give up on this ...

I guess you will have to go with the horizontal legend.

Thanks,

Ajit

Anonymous
Not applicable
Author

You may actually want to use this extension to replace your bar chart itself. I have not tried it but the picture appears to be with the legend following the same sequence of the stacked bar chart...

check it out - GitHub - yianni-ververis/SenseUI-BarChart: A more elegant and mobile friendly bar chart.

hope it works out,

Thanks,

Ajit

Not applicable
Author

Thank you, and everyone else, for all the help with this. As horizontal bar charts are not going to work for me, I think I'll have to do this in Qlik View. It seems to do everything I need, I just would rather work with Sense. Oh well, I guess I have no sense.

This is just the first of two hurdles I needed to get over. The next one, assuming I could have gotten over this one, is that if you manually change the colors of the bars, the legend becomes unavailable. Once again, this is not a  problem in View.

Jim