Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

coloured bar chart based on value

Hello,

I want to create a bar chart which is primarily very easy and already working. There is only costs based on material numbers. Now i want to colour each bar different, based on the amount behind each material number. The colour change should happen in example 10 steps from red to green, where red is the max. amount and green is the min. amount and all other colours between. How can i create this that this will work dynamic, because daily the data is changing and maybe the min or max gets different. Therefore the colour steps must be different.

Thanks, Armin

14 Replies
Not applicable
Author

Thanks a lot.

The colouring is working, but i am still not sure how i can get the legend into the dashboard. Furthermore, how can i adjust in the expression formula how many steps the system should calculate.

SergeyMak
Partner Ambassador
Partner Ambassador

Just copy  the load script, reload app and copy objects form my app and you will get your legend.

You don't need to adjust expression in the legend (table). Only in the two text boxes.

Unfortunately I don't see your expression and your dimensions, but I think it could be something like this:

=Max(Aggr(Sum(Your_Field), Your_Dimension1, Your_Dimension2,..... Your_DimensionN))

and same but Min(...)

Regards,
Sergey
SergeyMak
Partner Ambassador
Partner Ambassador

Please mark an answer if it was helpful or was a solution..

Regards,
Sergey
Not applicable
Author

Hello Sergey,

Thanks, one more question.

My expression looks like this:

ColorMix1 ((1+Sign(2*(Sperrdauer-RangeMin (top(total Sperrdauer,1,NoOfRows(total))))/(RangeMax (top(total Sperrdauer,1,NoOfRows(total)))-RangeMin (top(total Sperrdauer,1,NoOfRows(total))))-1)*Sqrt(Fabs((2*(Sperrdauer-RangeMin (top(total Sperrdauer,1,NoOfRows(total))))/(RangeMax (top(total Sperrdauer,1,NoOfRows(total)))-RangeMin (top(total Sperrdauer,1,NoOfRows(total))))-1))))/2, ARGB(255, 0, 128, 0), ARGB(255, 202, 0, 0))

Can you explain me more about this formula and how i can adjust to get always 10 steps?

Thank, Armin

SergeyMak
Partner Ambassador
Partner Ambassador

Hi Armin,

It's just generated by Qlikview and It's hard to explain just because I have never tried to understand how it works.

So there're definitely more steps then 10 if you have more then 10 different values in your data

Regards,

Sergey

Regards,
Sergey