Discussion board where members can learn more about Qlik Sense App Development and Usage.
Hi everyone,
Can anyone explain to me how the colours are assigned on a line chart when 'Colour by dimension' is selected? I have seen in other posts that it is done by load order, but this does not seem to completely explain it.
Below, you can see a line chart and a table. The table shows the dimension I have selected to colour by (called Series) and the minimum sequence numbers (RowNo() used in load script) and minimum record numbers (the order of which appears to be the same).
I have chosen the According to the 100 colors option (see enlarged version below) and the Peristent colors checkbox is automatically checked and cannot be unchecked.
As such, I would expect 'UK up to 01/01/2020 - Young bulls' to be coloured green, 'France - Young bulls' to be pink, 'Netherlands - Young bulls' to be red, 'Luxembourg - Young bulls' to be blue, etc. However, this is not the case. Instead, France is a dark brown colour, Luxembourg is a light pastel pink, Netherlands is a tan colour and the UK is not shown at all since the chart is restricted to the last 12 weeks. In addition, the colours change if I reduce the number of selected countries.
Thanks for your help.
Hi, the chart is using the series dimension, and this is a calculated dimension. Persistent colors are assigned to values loaded in script, try creating the SERIES field in script using the same condition: MEMBER_STATE_NAME & ' - ' & DESCRIPTION_EN, this way each value will have the same color.
Hi, if persistent colors is checked the values ar assigned in load order, that counts when the values were loaded while reloading the app. The color of the dimension should not change with selections so maybe ther is something behind this, I will need a sample to check.
Hi, the chart is using the series dimension, and this is a calculated dimension. Persistent colors are assigned to values loaded in script, try creating the SERIES field in script using the same condition: MEMBER_STATE_NAME & ' - ' & DESCRIPTION_EN, this way each value will have the same color.
Hi @rubenmarin ,
Thank you very much for your reply. I created a field in the load script as you said, and this now behaves as expected.
Regards,
Richard