Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Pyramid vs Row type for Custom Palette

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Sonja_Bauernfeind
Digital Support
Digital Support

Pyramid vs Row type for Custom Palette

Last Update:

May 10, 2022 3:21:58 PM

Updated By:

Jamie_Gregory

Created date:

Oct 2, 2018 9:15:39 PM

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.

Resolution:


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.

Pyramid

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.
Row

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:

  • Site 5: navy blue (#332288)
  • Site 4: the second blue (#6699cc)
  • Site 3: light blue (#88ccee)
  • Site 2: teal (#44aa99)
  • Site 1: green (#117733)

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

Labels (2)
Comments
Huberto
Creator
Creator

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

Sonja_Bauernfeind
Digital Support
Digital Support

Thank you for the feedback! 

Version history
Last update:
‎2022-05-10 03:21 PM
Updated by: