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.
Solved! Go to Solution.
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.
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.
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)
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 :
I think it's a best solution
Hope this helps.
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.