Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

marcoyukon
Contributor

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
Contributor III

Re: Color Expression and Chart Legend

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.

4 Replies
jonvitale
Contributor III

Re: Color Expression and Chart Legend

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

marcoyukon
Contributor

Re: Color Expression and Chart Legend

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

jonvitale
Contributor III

Re: Color Expression and Chart Legend

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
Contributor

Re: Color Expression and Chart Legend

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.

Community Browser