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: 
Anonymous
Not applicable

Color by expression for two different measure in a Combo Chart

Hi,

        I have a combo Chart, with two measures and one dimension. I need to specify user-defined colors for each measure(it can be achieved by Color by expression, i guess),

    How can i use a single expression to specific color to each measure in my visualization??

    Attaching the screenshot of my existing visualization which uses default color, where measures are Actual and Budget respectively and Dimension is Month. (Using Qlik Sense 3.0)

Capture.PNG

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi.

     As this capability is not available in line chart, i did an alternative to meet my requirement.

    I did the color code change in the theme files(theme.json) and its working fine.

View solution in original post

15 Replies
Not applicable
Author

Check out Steve Street's feedback on this thread

https://community.qlik.com/message/669606

Anonymous
Not applicable
Author

Actual in my requirement, I have a line chart with one Dimension(Month) and Two measures(Actual and Budget). I want to show the measure 'Actual'(Bar in the diagram) in 'Orange' color and the measure 'Budget'(Line in the diagram) in 'Blue' color. Means I need to write an expression so that it will check for measure(not the value for it).

In the above diagram, the legend shows the color blue as 'Actual' and purple as 'Budget', instead of that i want 'Orange' for actual and 'Blue' for budget.

Anonymous
Not applicable
Author

Hi.

     As this capability is not available in line chart, i did an alternative to meet my requirement.

    I did the color code change in the theme files(theme.json) and its working fine.

Not applicable
Author

Bijoy- I am sure I am asking a dumb question here but where do I find these files?

Anonymous
Not applicable
Author

C:\Users\<user>\AppData\Local\Programs\Qlik\Sense\Client\themes\sense\theme.json

C:\Users\<user>\AppData\Local\Programs\Qlik\Sense\Client\themes\bleak\theme.json

C:\Users\<user>\AppData\Local\Programs\Qlik\Sense\Client\assets\external\requirejs\require.js

The above path specified is in QlikDesktop version.

   Actual "require.js" is where we need to specify the color code(Color scheme for 12 Color and 100 Color)


   The other files are where we need to specify the priority of colors.

Not applicable
Author

Thank you !

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Awesome Bijoy,

now when editing require.js  there is about 5600 entries of color value, do you know which entries have to be edited?

sharing that knowledge would be very helpful

thanks Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Anonymous
Not applicable
Author

Actually i used a programming logic for this.

For Color scheme, i gave Multicolored, option -> 12 Color.

(Same can be used for "100 Color" and "8 Color")

In the above mentioned files, I searched for "12 Color" string and I found a 12 level color pattern, that matches 1 to 12 set of colors. Since in my requirement, i am using only two measures, the two color set(second line in the pattern) will be matching. So I understood those colors are showing by default. I changed it to my required color.

(All these changes are done in theme.json files). In theme.json, we were setting the color precedense.

While analyzing the reference structure, I understood that the actual color reference is going to require.js where this color code is assigning to the variable, that is used in the programming code.

Search for "12 Colors" in this file, and you will find where the default variable assignment for 12 color scheme is coded. If you find difficult to understand the logic, search for the default color you seen in theme.json file and replace it with your required color.

Restart QlikSense.

Job is done..

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Thanks,

that will do! I got it working and it is a huge benefit if you want to implement your own color schema to QlikSense charts.

regards

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.