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

Colors in bar chart

Hi,

Is it possible to use faded color for one version and normal colors for another.

e.g. In chart below I want faded colors for Past and normal for Current

Capture.JPG

Capture.JPG

Dimentions :

     Year

     =if(Version='2012','Past','Current')

     Therapeutic Area

Expression :

     sum(Revenue)

Thanks,

Prakash

1 Solution

Accepted Solutions
its_anandrjs

Hi,

Add a Flag field in your load like

if(Version=2012,'Past','Current')  as VerFlag

and in chart in sum(Revenue) expression click + sign and in Background type a code like

=if(VerFlag='Past' and [Therapeutic Area]='Hematology',RGB(188,205,224),

  if(VerFlag='Past' and [Therapeutic Area]='Oncology',RGB(253,176,168)))

Hope this helps

Thanks & Regards

View solution in original post

8 Replies
jsingh71
Partner - Specialist
Partner - Specialist

Go to the chart properties and put color function what you want under background color.

Bar.png

--Jai

linusblomberg
Creator II
Creator II

If you expand the expression you can very specific about the color in the "background color". You could say that if hematology 2012 then lightred(100) else lightred(). the 100 is the alpha which is what I think is what you are looking for. You can also enter the exact rgb values.

Hope this helps...

MK_QSL
MVP
MVP

Like this?

ThornOfCrowns
Specialist II
Specialist II

I didn;t know that you could set the Aplha like that - I've been using ARGB(x,x,x,x) to set it. Thanks!

linusblomberg
Creator II
Creator II

Glad I could help.

I usually also use ARGB since it gives complete control of the colors.

its_anandrjs

Hi,

Add a Flag field in your load like

if(Version=2012,'Past','Current')  as VerFlag

and in chart in sum(Revenue) expression click + sign and in Background type a code like

=if(VerFlag='Past' and [Therapeutic Area]='Hematology',RGB(188,205,224),

  if(VerFlag='Past' and [Therapeutic Area]='Oncology',RGB(253,176,168)))

Hope this helps

Thanks & Regards

its_anandrjs

Hi,

After flaging type a code below like in attached sample image

=if(Flag='Past' and [Therapeutic Area]='Hematology',RGB(188,205,224),

  if(Flag='Past' and [Therapeutic Area]='Oncology',RGB(253,176,168)))

Sample img.png

Hope this helps

Thanks & Regards

Not applicable
Author

Thanks Anand