We have a Visio drawing where we are using FillColor rather than alarming to color the shape. When we implemented HistoryMode using trend data, we can see the value of the shape changing as expected, however, the FillColor does not seem to apply to the HistoryMode returned value and still shows the color of the current value.
Is it possible to have the FillColor correlate to the HistoryMode value returned?
For our operation, we are using a parameter with values of 0, 25, 50, 75 or 100.
We have HistoryMode as a page setting -
State=[var:historyModeToggle]|TimeStamp=[var:myTimeR]|NoDataValue=<NOPE>|TrendDataType=Average
For the shape Parameter we are using the following FillColor option:
|FillColor;=0,Green;=25,Cyan;=50,Yellow;=75,Orange;=100,Red
Hi Steve,
With the current implementation of the historymode it is not possible to correlate the FillColor to the HistoryMode value. I would suggest that you create a task so we can add this functionality.
Although it's not the most straightforward way, it should be possible to do this with the new BackgroundColor shape data.
The History mode provides some placeholders to insert the history mode value:
- [average value]
- [minimum value]
- [maximum value]
Option 1: Nested regexreplace
Inserting this in a regexreplace could allow you to color the shape appropriately. For instance:
[regexreplace:100,[average value],Red]
Will replace the value with "Red" if the average value matches "100". Nesting a couple of these could give you the following BackgroundColor shape data:
- [regexreplace:0,
- [regexreplace:25,
- [regexreplace:50,
- [regexreplace:75,
- [regexreplace:100,[average value],Red]
- ,Orange]
- [regexreplace:75,
- ,Yellow]
- [regexreplace:50,
- ,Cyan]
- [regexreplace:25,
- ,Green]
The outer regexreplace could be left out if you make the default color of the shape green in Visio as well.
Option 2: Automation script output variables
You could also write the logic in an automation script that takes the value as input and outputs the text value of the color into a session variable.
For this you will need:
- Passing Automation script output to session variables
- Using the ValueChanged SetTrigger on page level to execute the script when the parameter value changes
- The [param:...] placeholder as script parameter input.
- The BackgroundColor shape data, which will then link to the session variable that is output by the script.
Thanks for the options Toon, I will have to see which if these will work better for the page I am working on.
Thanks for the answer Michael, I will submit a request shortly.