Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sarasmonu
New Contributor III

Custom Color

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

8 Replies
YoussefBelloum
Esteemed Contributor

Re: Custom Color

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
Honored Contributor II

Re: Custom Color

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
Esteemed Contributor

Re: Custom Color

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
New Contributor III

Re: Custom Color

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

alip_nath
Contributor

Re: Custom Color

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/...

OmarBenSalem
Esteemed Contributor

Re: Custom Color

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

OmarBenSalem
Esteemed Contributor

Re: Custom Color

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

alip_nath
Contributor

Re: Custom Color

cool. Can we define range?

Community Browser