Qlik Community

Knowledge

Search or browse our knowledge base to find answers to your questions ranging from account questions to troubleshooting error messages. The content is curated and updated by our global Support team

Announcements
QlikWorld online is next week! REGISTER NOW

Pyramid vs Row type for Custom Palette

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

Pyramid vs Row type for Custom Palette

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:
a week ago
Updated by: