Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cseward1963
Contributor

line chart legend

Under Colors and Legend, I changed the colors to "By Expression".  The line colors are as I like, but the Legend this dimension no longer displays when I use colors By Expression. 

1 Solution

Accepted Solutions
ogster1974
Honored Contributor II

Re: line chart legend

Celia the best way to achieve this is to make your dimension a master dimension and set the value colours yoursellf on it.  Available in Qlik Sense since Sept Release.

You can then use library colours and legend in the chart and it will reflect your custom colours.

Regards

Andy

18 Replies

Re: line chart legend

Hi Celia, I think that dimensions in legend only shows when is colored by dimension, in other case dimension values are not related with a specific color

cseward1963
Contributor

Re: line chart legend

Thanks for your reply Ruben, but I'm unclear on what you're saying.

ogster1974
Honored Contributor II

Re: line chart legend

The legend is disabled when you colour by expression.

Regards

Andy

ogster1974
Honored Contributor II

Re: line chart legend

If you are using the latest version you can make your dimension a master item and set your custom colour on the master dimension then you can colour by dimension.

.

Re: line chart legend

In 'Legend and colors' there is an option to color by dimension, in this case each dimension value is assigned to a color, and this is what is shown in legend.

In other cases the color are not directly related to dimension values, an expression can give a different color to a dimension value just because of different selections (changing the value returned for the expression and the color of a dimension value)

justinphamvn
Contributor II

Re: line chart legend

Hi Celia,

I had the same problem with you and I had used a Picture (Capture a legend you want) instead of used the legend

Something like this :  

LegendSC.PNG

I think it's a best solution

Hope this helps.

Justin.

cseward1963
Contributor

Re: line chart legend

Hi Justin.  How were you able to "Capture a legend"?

justinphamvn
Contributor II

Re: line chart legend

Hi Celia,

You could create a new application (application temp - purpose to get legend ) with value you want to show the Chart (Chart you 'd like to create legend on the main application).

And create chart with legend (Maybe scatter plot chart), then capture the legend as picture

Finally, you used this picture like a legend for the Chart on the main application.

Summary solution: Used the legend of the another application (Picture), then used it for current application (turn off show legend and used "picture legend" - add image on the dashboard)

I hope you understand this solution.

Thank you,

Justin.

Highlighted
cseward1963
Contributor

Re: line chart legend

I understand what you're saying, but I still don't know the mechanics on how to "capture the legend as picture".