Dear b&r team.
I tried to configure the progress bar like the control in VC4 (i guess it was bargraph)
I want to change the color in dependency of the connected value.
For Example:
from 0 to 10%: red
from 10 to 50%: orange
from 50 to 100% green. → like in VC4
Can i do it by using events? if yes how i need to configure it.
i use AS 4.10 and mappview 5.24
Hello,
I could not find a property on the progress bar widget to accomplish that natively.
Using the property style as a binding could be an option.
Using an event binding would be possible, e.g reacting on the values changed and then using the SetStyle action for the progress bar.
In any case the style has to be defined in the style sheet to be used in (event) binding.
I did not test this yet, please feel free.
Best regards
Fabian
Hello,
Its possible using a linear gradient. Might only be supported in AS6 or 6.1.
If you upgrade you’ll get that and a few more nice features.
Im AS4 you can use the paper widget and build a nice fully loaded progress bar and cover it with another element. Then you can transform the overlaying element to reveal it gradually dependent on percentage loaded.
I recommend you to find some CC-licensed ready made SVG for progress bar and just edit it for your needs in inkscape.
BR
Carl
Hello Carl,
as is have checked, using the linear gradient is not the goal for me.
Like in VC4 it was possible to change the complete color depending of the value.
I want to use it to show a fill progress. When the level meets close to empty, it should be complete red. For half filled complete orange, for level close around “full” the var should be complete green
Where do i find this cc licensed ready or maybe other widgets?
Raimund
Edit: Go for @marcel.voigt solution , if you wanna over engineer it, read below
Aha, If thats the case you should create 3 styles for the progress bar.
- Progressbar_Green
- Progressbar_Yellow
- Progressbar_Red
Then bind the style of the progress bar to a variable, e.g. progressBarColor.
The easy route is to make progressBarColor an OPC UA variable that has the value of the name of the style. Then you can easily assign the style name based on progress made.
0 - 50 % → progressBarColor = “Progressbar_Green” etc
You could also put the logic for setting the value to progressBarColor in mappview using expressions and session variables.
The result will be that the entire progress bar changes its color based on the progress that has been made. This will work in AS4 and AS6
Don’t even need anything fancy for this just to extend on Carl’s solution
Just one simple EventBinding
Hello all,
Marcel: thank you for your sample. Thats exact what i need.
Raimund