Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sarasmonu
Creator
Creator

Custom Color

Want to give stacked bar chart custom color. Please tell how do we do it

8 Replies
YoussefBelloum
Champion
Champion

Hi,

barchart.png

on the colors tab on the right of the screen, deselect Auto coloring, and choose color by expression on the Drop-Down list.

there you can set your own expression which must uses the RGB() function.

example for red colors:

=RGB(255,0,0)

ogster1974
Partner - Master II
Partner - Master II

you can also set custom colours on master dimensions and measures now and use them in your charts if you want to easily apply across your application.

Regards

Andy

OmarBenSalem

I think this is what he's looking for !

Suppose u have a dimension : customer

and 2 measures :

sum(sales1) and sum(sales2)

u want to show them in a stacked bar, sum(sales1) as red, sum(sales2) as yellow

1) create 2 master measures:

a) sum(sales1) : color it as red

Capture.PNG

b) sum(sales2) : color it yellow

2) Now, in ur bar chart, choose as measures, the newly created master ones:

Capture.PNG

result:

Capture.PNG

sarasmonu
Creator
Creator
Author

The stack is out of Dimension. Can you help me with that?

Olip
Creator
Creator

Under Appearance>Colors & Legend >Colors Custom.

Then you have option by dimension,measure or expression.First 2 options are self explainatory, for the 3rd option by expression

you can define a specific rule and color as well


for e.g


if([ Segment(InSalesOnly)]='XYZ',rgb(60, 115, 157),

if([ Segment(InSalesOnly)]='ABC',rgb(227, 95, 42),

if([ Segment(InSalesOnly)]='IT Platform - TPG',rgb(227, 148, 42),

if([ Segment(InSalesOnly)]='ASD',rgb(227, 181, 42),

if([ Segment(InSalesOnly)]='EFG',rgb(255, 223, 126))))))


Custom color options can be found here:

http://help.qlik.com/en-US/sense/3.2/Subsystems/Hub/Content/Colors/color-by-expression.htm

http://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/ChartFunctions/ColorFunctions/...

- Eager to learn n grow,

Olip
OmarBenSalem

Same thing, create ur 2 dimensions as master dimensions, and assigne colors to them..

OmarBenSalem

u can do this even easier Alip; now u can assign colors to ur dimension values when u create ur dimension as a master one:

Capture.PNG

Olip
Creator
Creator

cool. Can we define range?

- Eager to learn n grow,

Olip