Modify the pen style of a point during run time
Use Style Modifier to modify the pen style of a point in a trend control.
By default, the data points in a trend control are drawn with a solid, black line. You can change the style of the line — more specifically, you can change the style of the pen that draws the line — by changing the settings in the Pen Style dialog box. The user can also open the Pen Style dialog box during run time and change the settings then. For more information, see Pen Style dialog box
<Parameter1>=<Value1>;<Parameter2>=<Value2>;…;<ParameterN>=<ValueN>
Parameter | Description | Accepted Values |
---|---|---|
Expansion | The method or algorithm used to connect the data points. |
|
Type | The type of line (e.g., solid, dashed, dotted) that connects the data points. |
|
Weight | The weight (i.e., thickness) of the line, in pixels. | from 0 to 10 |
Color | The color of the line.
For more information about colors in IWS, see Color Interface. | a 24-bit color value from 0 to 16777215 |
You could specify literal values for any or all of the parameters, but that is effectively the same as using the Pen Style dialog box to configure those settings. The key to programmatically modifying the pen style is specifying tag names or expressions enclosed in curly brackets ({}) for the parameter values. Then, whenever the value of a specified tag/expression changes, the pen style is modified.
Expansion={ExpansionTag};Color={RGBColor(0,0,ColorTag)}
For the parameter Expansion, you specified the project tag ExpansionTag enclosed in curly brackets. There are only two accepted values (0 and 1) for Expansion, so ExpansionTag could be Boolean type. Then, whenever the value of ExpansionTag changes during run time, the expansion method is modified accordingly.
For the parameter Color, you specified an expression that calls the function RGBColor to convert RGB color values to a 24-bit color value. The red and green color values remain constant at 0, but the blue color value is determined by the project tag ColorTag. Then, whenever the value of ColorTag changes during run time, the value returned by the function also changes and the line color is modified accordingly.
Following this example, you can specify any project tags or expressions for the parameters as long as their returned values are within the accepted values for the parameters.