Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
humesh_sindpure
Partner - Contributor III
Partner - Contributor III

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
Creator
Creator

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
Partner - Contributor III
Partner - Contributor III
Author

No sir

I dont want to use color master item

I need a code for developing custome color property for dimentions

ajaykakkar93
Specialist III
Specialist III

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"

                                       

                                                                      }

                                                    }

                                              },

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting