Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bar Chart Color -> above and below Value

Hi,

i want to create a chart like this:

Bar char example.jpg

I think i could create this with a stacked bar chart.

But i dont know how to apply different colors according to being above/below plan value.

Does someone has already implemented something like that?

Phil

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Three expressions in a stacked bar chart:

=Rangemin(sum(Expression3), vThreshold)

=if(sum(Expression3)>vThreshold, sum(Expression3)-vThreshold)

=if(sum(Expression3)<vThreshold, vThreshold-sum(Expression3))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

11 Replies
tresesco
MVP
MVP

See attached sample qvw

swuehl
MVP
MVP

Maybe like attached?

Two expressions in a stacked bar chart:

=Rangemin(sum(Expression3), vThreshold)

=if(sum(Expression3)>vThreshold, sum(Expression3)-vThreshold)

Anonymous
Not applicable
Author

Hey thanks guys! That really helps me.

But how can i change the expression to geht it in another color if its below plan?

Bar chart example 2.jpg

tresesco
MVP
MVP

Could you post your sample qvw ?

swuehl
MVP
MVP

Open the expression attributes of the first expression by clicking on the small plus sign next to the expression label on upper left corner of expression tab.

Then edit the background color attribute expression:

=Black()

jonathandienst
Partner - Champion III
Partner - Champion III

Three expressions in a stacked bar chart:

=Rangemin(sum(Expression3), vThreshold)

=if(sum(Expression3)>vThreshold, sum(Expression3)-vThreshold)

=if(sum(Expression3)<vThreshold, vThreshold-sum(Expression3))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
HirisH_V7
Master
Master

Hi,

PFA,

For Line and Mutlicolored Stacks .

I hope this Helps,

Mutiple color bar chart based on range.PNG

Regards,

Hirish.

HirisH
Anonymous
Not applicable
Author

Hi Jonathan,

thats the right answer!

Thanks alot!

Phil

Anonymous
Not applicable
Author

Got another requirement.

So far it looks like:

Bar Chart Example 3.jpg

If I select more than one Year it looks like:

Bar Chart Example 4.jpg

How can i get this to show grouped? I guess thats not possible?

At the moment ive got one expression for each year.