Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
NEW webinar Dec. 7th: 2023 Outlook, A Pivotal Year for Data Integration SIGN ME UP!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcoyukon
Creator
Creator

Color Expression and Chart Legend

I can't seem to find a way to display the legend in a trend chart series when I use an expression to define the colors. The legend disapears when "By Expression" is selected. Then I ran into this old post below with the same question and I don't know if a better solution was ever created. https://community.qlikview.com/thread/200757 Any help on this would be appreciated.

1 Solution

Accepted Solutions
jonvitale
Creator III
Creator III

Yeah, that won't work.

What I've done as a workaround is use a Treemap as a legend. I just use 1 as the measure, so that each dimension will have the same value (all the boxes will be the same size), then use the same color expression as the chart.

View solution in original post

5 Replies
jonvitale
Creator III
Creator III

Did you turn off "The expression is a color code"?

marcoyukon
Creator
Creator
Author

This option is ON as I need the expression to dictate the colors.

jonvitale
Creator III
Creator III

Yeah, that won't work.

What I've done as a workaround is use a Treemap as a legend. I just use 1 as the measure, so that each dimension will have the same value (all the boxes will be the same size), then use the same color expression as the chart.

marcoyukon
Creator
Creator
Author

Thanks. I used this as a workaround. However, I think it would be ideal if using an expression as a color would not dictate whether or not to remove the legend. Seems logical to keep it. Another solution I was working on was creating calculated measures using set expression and color coding on the measure itself, but the downside is you lose the ability to select the series you want to view on the chart.

SonOfJeffGoldblum
Contributor III
Contributor III

If you create a master dimension you can set the color values

Then Set by Dimension using your master dimension and voila

SonOfJeffGoldblum_2-1594906674997.pngSonOfJeffGoldblum_3-1594906679997.png

 

 

 

 

Everything not saved will be lost
— Nintendo Quit screen message