Legend will be disabled when 'The expression is a color code' is turned on
When setting charts' appearance with colour by the expression, the legend is hidden and the corresponding options in property manual is disabled.
Charts affected: Bar chart, Combo Chart, Gauge, Line Chart, Pie Chart, Scatter plot Charts are not applicable: Map, Table, Text&Image, Treemap, extensions with no legend support.
The reason is that 'final calculated colour' of each 'data point' will not be recognized and captured by Qlik Sense. As a result, the legend will never show the correct colour unless an expensive calculation is performed after rendering, which affects user experience of the product.
This is working as designed.
A recommendation to use default color scheme provided instead. Expression can be set to a value among the total range, in order to determine the color in the scheme. For instance:
Give an expression to 'color by expression' like this:
if([Actions.DueDates]='Overdue <5 days', 50,
if([Actions.DueDates]='Overdue 5 - 15 days', 100,
if([Actions.DueDates]='Overdue >15 days', 200,
if([Actions.DueDates]='<15 days remaining', 500,
if([Actions.DueDates]='>15 days remaining', 1000,
if([Actions.DueDates]='Completed', 2000 ))))))
Then the color can be 'controlled' by given a score in number: 50, 100, 200...