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

Where can I change the default Bar Chart colour by IDs?

I know that one can change it in the Color tab. But how and where can I change the Colour of my Bar Chart on ID e.g. Supplier level. Thank you!

15 Replies
Not applicable
Author

click on that + symbol of  chart name  u will have options like background color,text color  change it..

Agis-Kalogiannis
Employee
Employee

Hi Abdul

So what you can do is to click on the + symbol in your expression, and in the Background color option, add something lik this as an expression:

if(DivisionName='EMEA', RGB(255,0,0),

  if(DivisionName='North America', RGB(255,255,0),

       if(DivisionName='South America', RGB(0,0,255))))

This changes the color depending on the DivisionName value.

I hope this helps.

Agis

Not applicable
Author

But if you use this approach and have like 100s IDs you would have 100s of ifs which might not work right?

Not applicable
Author

did u try in + symbol option ?

i guess no way if u have 100 or 200 u need to do in this way

Agis-Kalogiannis
Employee
Employee

I agree with you Abdul.

You would do something like this only if you had limited number of values in a dimension.

But if you had 100-200 different values, why would you need to control the color based on these values (or IDs)?

Could you please give us an example on what exactly you're trying to do?

Thanks

Agis

Not applicable
Author

May be I should ask the question some other way. What are the possibilities to set colours of bar charts default and not default. And is there a possibility where you can say for all IDs doesn t matter how many IDs you have.

Agis-Kalogiannis
Employee
Employee

Another way of doing it Abdul is to create a variable and store your color in there.

Example:

vSales = rgb(200,100,40) or vMargin = LightBlue()

So whenever you create a chart and you use a sales expression like sum(Sales), you can click the + next to the expression you create and use the color variable you want $(vSales) in the Background Color option.

You can even create a list of color variables in an external excel file and load them in your application. Then you can use any variable you want depending on the expression you create.

Is that closer to what you're trying to do?

Anonymous
Not applicable
Author

There are several methods. If you want to set a specific colour for each value in a dimension then you can either set variables as mentioned above or put the RGB values into your data model as three fields. You can then call them with the RGB function in the Background Color section of the expression.

If you do not want to pick the colours and just want a consistent colour for each value in the dimension then try using

color(fieldindex('field',field))

Where field is your dimension name. This will essentially find the field index (the order of each value in the field) and then use this to call one of the inbuilt colours.

Not applicable
Author

using field index can we not use inbulit Qlik colors but colors which we have given in color palette . Is this possible?