Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

stack bar chart colors

hi all

is it possible to change bar colors?

ilanbaruch_0-1689144857617.png

 

advanced thanks

Labels (1)
1 Solution

Accepted Solutions
tealowk
Partner - Contributor III
Partner - Contributor III

This is indeed possible.

Let's take this example which shows the distance travelled with different means of transport. 

tealowk_0-1689578705165.png

Now I want to show 'Car' in one colour and 'Bike' and 'Motocycle' in another. In the Appearance tab, I can set my colour to follow a certain expression.

tealowk_1-1689579031908.png

In my case that would be:

=if(Vehicle='Car', blue(), green())

And the result looks like this (can still be sorted, of course):

tealowk_2-1689579207669.png

Kind regards,

Thilo

View solution in original post

4 Replies
tealowk
Partner - Contributor III
Partner - Contributor III

Hi Ilanbaruch,

It is indeed possible to change the colours in a bar chart.

Please refer to the documentation on how to change the colours in a visualisation: help.qlik.com 

Hope that helps.

Kind regards from Brussels,

Thilo

ilanbaruch
Specialist
Specialist
Author

thank you Tealowk,

you are right, in the master items i can set a specific color to dimension.

i am looking for an option to change the color according to dimension value within the dimension, i.e.:

if(field_value=1,red(),green())

is it possible? 

tealowk
Partner - Contributor III
Partner - Contributor III

This is indeed possible.

Let's take this example which shows the distance travelled with different means of transport. 

tealowk_0-1689578705165.png

Now I want to show 'Car' in one colour and 'Bike' and 'Motocycle' in another. In the Appearance tab, I can set my colour to follow a certain expression.

tealowk_1-1689579031908.png

In my case that would be:

=if(Vehicle='Car', blue(), green())

And the result looks like this (can still be sorted, of course):

tealowk_2-1689579207669.png

Kind regards,

Thilo

ilanbaruch
Specialist
Specialist
Author

thank you @tealowk !

for some reason i unchecked the "The expression is a color code" 🙂