Range rendering in numeric data point not displaying color
-
Attempting to use a numeric data point with 'range' selected as renderer, and multiple ranges with distinct text values and colors applied to them as @JoelHaggar suggested. Text values appear as expected, but text is not colored. Any other directive or properties I'm missing?
<ma-point-value enable-popup="hide" point-xid="VP_t1"></ma-point-value>
renders:
<ma-point-value enable-popup="hide" point-xid="VP_t1" class="ma-live-value"><!----> <!----><span ng-if="$ctrl.resolvedDisplayType !== 'image'" ng-style="$ctrl.valueStyle" ng-class="classes" class="value" ng-bind="$ctrl.displayValue" style>DESIRED TEXT</span><!----> <!----> <!----> <!----> <!----> <!----> <!----> </ma-point-value>
Note the lone 'style' text at the end of the opening span tag. Sometimes it is 'style=', or not there at all.
-
Hi bullitbd,
The only way I was able to reproduce was to add a semicolon at the end of the colors when creating my range renderer. Perhaps you have put a semi-colon at the end of the color definition for the ranges? As in,
"rangeValues":[ { "colour":"#228b22;", "from":-1000.0, "text":"neg", "to":0.0 }, { "colour":"#a52a2a;", "from":0.0, "text":"pos", "to":1000.0 } ]
vs.
"rangeValues":[ { "colour":"#228b22", "from":-1000.0, "text":"neg", "to":0.0 }, { "colour":"#a52a2a", "from":0.0, "text":"pos", "to":1000.0 } ]
-
Unfortunately, @phildunlap, that isn't the case - I've included the whole point below. Did you see my note about the lone
style>
tag in the span? Seems odd..."dataPoints":[ { "xid":"DP_t1_state", "name":"t1_state", "enabled":true, "loggingType":"INTERVAL", "intervalLoggingPeriodType":"MINUTES", "intervalLoggingType":"AVERAGE", "purgeType":"YEARS", "pointLocator":{ "range":"HOLDING_REGISTER", "modbusDataType":"TWO_BYTE_INT_SIGNED", "writeType":"SETTABLE", "additive":1.0, "bit":0, "charset":"ASCII", "multiplier":1.0, "multistateNumeric":false, "offset":100, "registerCount":0, "slaveId":1, "slaveMonitor":false }, "eventDetectors":[ ], "plotType":"SPLINE", "rollup":"NONE", "unit":"", "templateXid":"PT_Tank_State", "simplifyType":"NONE", "chartColour":"", "chartRenderer":{ "type":"IMAGE", "timePeriodType":"DAYS", "numberOfPeriods":1 }, "dataSourceXid":"DS_Brix", "defaultCacheSize":1, "deviceName":"Brix", "discardExtremeValues":false, "discardHighLimit":1.7976931348623157E308, "discardLowLimit":-1.7976931348623157E308, "intervalLoggingPeriod":1, "intervalLoggingSampleWindowSize":0, "overrideIntervalLoggingSamples":false, "preventSetExtremeValues":false, "purgeOverride":false, "purgePeriod":1, "readPermission":"", "setExtremeHighLimit":1.7976931348623157E308, "setExtremeLowLimit":-1.7976931348623157E308, "setPermission":"", "tags":{ }, "textRenderer":{ "type":"RANGE", "useUnitAsSuffix":false, "unit":"", "renderedUnit":"", "format":"0.00", "rangeValues":[ { "colour":"#ff0000", "from":-100.0, "text":"FAULT", "to":-1.0 }, { "colour":"#87ceeb", "from":0.0, "text":"IDLE", "to":0.0 }, { "colour":"#ff8c00", "from":1.0, "text":"EMPTY", "to":1.0 }, { "colour":"#32cd32", "from":2.0, "text":"FILLING", "to":2.0 }, { "colour":"#ff8c00", "from":3.0, "text":"ADD", "to":3.0 }, { "colour":"#32cd32", "from":4.0, "text":"READY", "to":4.0 }, { "colour":"#32cd32", "from":5.0, "text":"PROCESS", "to":5.0 }, { "colour":"#ffff00", "from":6.0, "text":"OVERFILL", "to":6.0 } ] }, "tolerance":0.0 } ] }```
-
HI @bullitbd
I used your rangeValues and was able to reproduce your problem. On the data point details page of that point you get the same problem...
To fix it I changed the ranges as follows;
from:1
to:1
---->
From: 0.9
To: 1.9 -
Good instincts, @CraigWeb. I tested a tighter range (.999 to 1.001), and it worked as well. Clearly the algorithm is
from < value < to
, non-inclusively.Under Text renderer properties context help, "...The number format is used if the value does not fall within a defined range..." Might be good to change that sentence to "...does not fall between a defined range..." (even though that sounds a bit off).
-
@bullitbd I've fixed the bug on the backend and frontend so the text and color is applied consistently and is inclusive. If the ranges overlap the higher range takes precedence. This will be released in 3.6.0.
-
cool @Jared-Wiltshire . thanks.