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: 
NareshGuntur
Partner - Specialist
Partner - Specialist

Customized colors for bars

Hi,

I have data something like this.

Test:

Load * inline [

A, ORD, C

1, 11, 111

2, 22, 222

3, 33, 333

4, 44, 444

];

And I tried creating a bar chart with A as dimension and ORD & C as measures.

Qlik Sense by default colors it. Is there any way that I can give a red() to ORD and a blue() to C??

Cheers,

Naresh

1 Solution

Accepted Solutions
NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Thanks guys for your time and responses.

Ian's idea helped me here.    https://community.qlik.com/docs/DOC-8492#comment-41642

Cheers,

Naresh

View solution in original post

8 Replies
sasikanth
Master
Master

HI

Go to

Properties --> custom colors and legend --> select by Expression from drop down-->

There you can write your own expression

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Thanks for the response Sunny.

What kind of expression do you think can be written?

I basically want the similar thing which is done in Colors tab in QlikView where I can assign different color to each expression.

"Properties --> custom colors and legend --> select by Expression from drop down-->

There you can write your own expression"

Nothing strikes my mind.

Cheers,

Naresh

reddy-s
Master II
Master II

Hi Naresh,

You can coloue the bars the way you want.

For complex coloring options use

Colormix()

Else use:

RGB()

ARGB()

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Thanks Sangram.

Can you please elaborate this?

Where to use and what'll be the expression for colors?

I just want red() to ORD and a blue() to C or vice-versa but should be driven and not automatic.

Cheers,

Naresh

reddy-s
Master II
Master II

So try this,

RGB(255,0,0) for red and rgb(0,0,255) for blue.

Assuming that the dimension used in the visualization has values A ,B , C........etc

the colour expression would be.

If (Dimension = 'A', RGB(255,0,0),//Red

if(Dimension = 'B', RGB(0,0,255),RGB(255,196,0)))//Blue//Amber

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Sorry if my question mislead you.

My query says, the colors need to be changed by expression and but not by dimension values.

By Dimension values is straight forward with an if condition.

Can you please upload a .qvf with the above inline load which I have posted above.

Cheers,

Naresh

reddy-s
Master II
Master II

Hi Naresh,

I am sorry that i am not able to understand what exactly you are looking for. Do you want to colour you bar chart with a measure? is the measure used in the barchart?

Thanks,

Sangram Reddy.

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Thanks guys for your time and responses.

Ian's idea helped me here.    https://community.qlik.com/docs/DOC-8492#comment-41642

Cheers,

Naresh