GaugeAddColorRange method (WinStudio scripts)
Applies To
IWSFormComponent interface
Definition
This method adds a color range to a gauge component, using line elements to define the color range attributes.
Syntax
Dim colorRangeName As ColorRange
colorRangeName.attributeX = valueX
gauge.GaugeAddColorRange( colorRangeName )
Part | Description |
colorRangeName | Required. Specifies the name by which the color range is to be identified. |
attributeX | Optional. Specifies the name of a color range attribute. |
valueX | One required for each attribute specified. Specifies the value to be assigned to attirbuteX. |
Remarks
You should declare and name the each color range and its attributes before you attempt to use this method to add the color range to the gauge. It is also a good practice to employ the GaugeClearColorRanges method before you declare and use this one.
You can use this method to define multiple color ranges.
For a complete list and description of the color range attributes available for scripting, see “Specifying color ranges for gauges”.
Example
In this example, a GaugeClearColorRanges method is invoked first, to clear any color ranges that might currently be defined for the gauge component. Following that, three color ranges are declared, their attribute values assigned, and an instance of GaugeAddColorRange is invoked for each range.
This example is given in Visual Basic.
gauge.GaugeClearColorRanges()
Dim r1 As ColorRange
Dim r2 As ColorRange
Dim r3 As ColorRange
r1.MinValue = 0
r1.MaxValue = 20
r1.Code = "0000FF"
gauge.GaugeAddColorRange(r1)
r2.MinValue = 21
r2.MaxValue = 60
r2.Code = "00FF00"
gauge.GaugeAddColorRange(r2)
r3.MinValue = 61
r3.MaxValue = 100
r3.Code = "FF0000"
gauge.GaugeAddColorRange(r3)