Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

humesh_sindpure
New Contributor II

custome color property for dimention

Hello,

I want to give custome color property for background color to perticular dimention .

but I dont know how to given it .can you guys please help me to solve this problem ?

here is my javascript  code for

define( ["qlik","jquery", "text!./style.css", "text!./template.html"], function (qlik, $, cssContent, template ) {'use strict';

    $("<style>").html(cssContent).appendTo("head");

  return {

       template: template,

          initialProperties : {

              qHyperCubeDef : {

                   qDimensions : [],

                   qMeasures : [],

                   qInitialDataFetch : [{

                                            qWidth : 10,

                                            qHeight : 50

                                           }]

                     }

              },

       definition : {

                  type : "items",

                  component : "accordion",

                  items : {

                         dimensions : {

                                             uses : "dimensions",

                                               min : 1,

                                             items:{

                                                    colorExpression:{

                                                                              type: "string",

                                                                             label: "Enter color expression",

                                                                             component: 'expression',

                                       ref:"qHyperCubeDef.qDimensionsInfo.0.qAttributeExpressions.0.qExpression",

                                                                    expression: "optional"

                                        

                                                                      }

                                                    }

                                              },

                          measures : {

                                         uses : "measures",

                                       min : 0

                                            },

                             sorting : {

                                         uses : "sorting"

                                         },

                            settings : {

                                          uses : "settings",

                                          items : {

                                                   initFetchRows : {

                                                                      ref : "qHyperCubeDef.qInitialDataFetch.0.qHeight",

                                                                      label : "Initial fetch rows",

                                                                       type : "number",

                                                                    defaultValue : 50

                                                                     }

                                                       }

                                           

}

                            }

  },

  support : {

                snapshot: true,

                 export: true,

              exportData : true

                 },

  paint: function ( ) {

  //setup scope.table

                      if ( !this.$scope.table ) {

                       this.$scope.table = qlik.table( this );

                        }

                         return qlik.Promise.resolve();

                 },

      

       };

} );

erik.wetterberg

prabhuappuberryandcherry64‌@

3 Replies
hacr-sds
Contributor

Re: custome color property for dimention

Just a quick question. Are you talking about themes or can you accept the "color master items" ?

Using this https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Colors/assigning-colors-to-di...

humesh_sindpure
New Contributor II

Re: custome color property for dimention

No sir

I dont want to use color master item

I need a code for developing custome color property for dimentions

ajaykakkar93
Contributor

Re: custome color property for dimention

hi humesh_sindpure

     you can use

     qAttributeExpressions.0.qExpression

instead of

     qHyperCubeDef.qDimensionsInfo.0.qAttributeExpressions.0.qExpression

items:{

                                                    colorExpression:{

                                                                              type: "string",

                                                                             label: "Enter color expression",

                                                                             component: 'expression',

                                       ref:"qAttributeExpressions.0.qExpression",

                                                                    expression: "optional"

                                       

                                                                      }

                                                    }

                                              },

Regards & Thanks,
Ajay Kakkar
ajaykakkar93@gmail.com
Community Browser