Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
There are two different palette types that can be used when creating a custom theme. The custom palettes are applied when using the Color By feature for chart in Qlik Sense. The two different available types are Pyramid and Row.
The Pyramid type allows customization of the color palette used based on the number of data members.
Here is an example code snippet for a color palette using Pyramid as the type:
"palettes": { "data": [ { "name": "First data palette", "translation": "12 colors", "propertyValue": "data-palette-1", "type": "pyramid", "scale": [ [ "#4477aa" ], [ "#4477aa", "#cc6677" ], [ "#4477aa", "#ddcc77", "#cc6677" ], [ "#4477aa", "#117733", "#ddcc77", "#cc6677" ], [ "#332288", "#88ccee", "#117733", "#ddcc77", "#cc6677" ], [ "#332288", "#88ccee", "#117733", "#ddcc77", "#cc6677", "#aa4499" ], [ "#332288", "#44aa99", "#88ccee", "#117733", "#ddcc77", "#cc6677", "#aa4499" ], [ "#332288", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#cc6677", "#aa4499" ], [ "#332288", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#cc6677", "#882255", "#aa4499" ], [ "#332288", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#661100", "#cc6677", "#882255", "#aa4499" ], [ "#332288", "#6699cc", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#661100", "#cc6677", "#882255", "#aa4499" ], [ "#332288", "#6699cc", "#88ccee", "#44aa99", "#117733", "#999933", "#ddcc77", "#661100", "#cc6677", "#aa4466", "#882255", "#aa4499" ] ]
If there was one data member in the chart, the 1st line would be used. If there were two data members in the chart, the 2nd line of colors would be used and so on and so forth up to 12 data members.
For example, the below pie chart has 5 data members. So it is using row 5 of the above code snippet to assign the colors.
The type of Row, however, will use the colors listed in order and should there be more data members than assigned colors, the colors will be reused.
Here is an example code snippet for a color palette using Row as the type:
"name": "Second data palette", "translation": "4 Colors", "propertyValue": "data-palette-2", "type": "row", "scale": [ "#ff00ff", "#00ff00", "#0000ff", "#000000" ]
Using the same pie chart but with the 4 color palette, the colors are assigned in the order listed in the code snippet. The pink is used twice because there are 5 data members in the pie chart but only 4 colors in the palette.
If instead of a 4 color palette, the 12 colors were used as a Row type palette, the colors would be assigned in the order listed in the code. Using the same pie chart example, the colors would be assigned as follows:
This would result in a very similar color palette of blues and greens and not very much variance in the colors. Therefore, using the pyramid allows you to set more variance in the color scheme based on how many data members are in the chart.
For more information here about creating Custom Themes, please see: Custom theme JSON properties
Dear @Sonja_Bauernfeind,
Thank you for clarifying the difference between Pyramid and Row type for the palettes.
I consider it a valuable explanation to be added to the QS Help because I looked for the exact explanation in didn't find it in the help.
Best regards,
Huberto Pereira Haidemann
Thank you for the feedback!