Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rbartley
Specialist II
Specialist II

How are colours assigned on a line chart when 'Color by dimension' selected?

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.  

rbartley_1-1673526593772.png

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.

 

rbartley_0-1673526318021.png

Thanks for your help.

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

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.

View solution in original post

4 Replies
rubenmarin

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.

rbartley
Specialist II
Specialist II
Author

Hi @rubenmarin ,

 

Thanks for your reply, I've attached the qvf below.

rubenmarin

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.

rbartley
Specialist II
Specialist II
Author

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