Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Giwa_Temitopoluwa
Contributor
Contributor

Color

I have been having problem with customizing my bar charts with my own defined colors(divergent or gradient) but I'm only able to use the auto customization or the default color mix or choose colors one by one for the bars which I can't afford to do for a large bar chart.Can anyone help with a better way?

Labels (4)
1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

If you are not happy with the 2 provided color schemes, you can always create a custom theme and specify a different custom color scheme that you can use.

 

The second color solution is indeed not scalable as it is, which is why you can create a new table in Data load editor with predefine colors like:

 

Load * inline [

Country, Color

France, #454545

Germany, #00FF02 

Italy, #982525 
etc.

];

 

And then assign the colors to your Bar chart with Expression by using a much simpler expression. 

 

I hope that this info is helpful.

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

3 Replies
Andrei_Cusnir
Specialist
Specialist

Hello,

 

If you are looking for a way to customize the Bar chart's bars colors based on the country then there are 2 different ways to do so:

 

1. Use the "By dimension" option and you can define custom color schemes with a custom theme [1]. However, please keep in mind that those colors are not applied based on the country but based on the order of the bar charts.

 

2. If you are looking for a more specific color assignment, then the only option is "By expression" and the example is:

If (
 Country = 'Germany',
 Green(),
 If (
   Country = 'USA',
   Red(),
   If (
     Country = 'France',
     Yellow(),
     Blue()
   )
 )
)

 

The second solution will give you a much better customizable option, however it is not that scalable. Although, you can define the colors as #454545 etc. in your dataset, for each country and then use it in the expression directly.

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members. 
 

---

[1] https://help.qlik.com/en-US/sense-developer/May2022/Subsystems/Extensions/Content/Sense_Extensions/C...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
Giwa_Temitopoluwa
Contributor
Contributor
Author

additional info: the first solution is the default custom color mix(what if I don't want that color scheme?) , the second color solution is not convenient for a larger bar chart.I need a more convenient color assignment method for a large bar chart

Andrei_Cusnir
Specialist
Specialist

Hello,

 

If you are not happy with the 2 provided color schemes, you can always create a custom theme and specify a different custom color scheme that you can use.

 

The second color solution is indeed not scalable as it is, which is why you can create a new table in Data load editor with predefine colors like:

 

Load * inline [

Country, Color

France, #454545

Germany, #00FF02 

Italy, #982525 
etc.

];

 

And then assign the colors to your Bar chart with Expression by using a much simpler expression. 

 

I hope that this info is helpful.

Help users find answers! Don't forget to mark a solution that worked for you! 🙂