On Initialize
- Last UpdatedJun 25, 2024
- 1 minute read
Use scripts for the On Initialize event of a Gauge control to accomplish a desired operation after the control has been initialized, but before it is rendered to the UI. You can therefore change the configuration of the gauge at runtime.
Example
If you want to:
-
set the value of the control to 50
-
set the minimum and maximum value of the scale to 0 and 180
-
set the start and end angle of the scale to -20 and 200
-
set the target value to 120
-
set the minor and major units of the scale to 15 and 30
then code the script for the On Initialize event of the control as follows:
control.value=50;
control.scaleMin=0;
control.scaleMax=180;
control.scaleAngleStart=-20;
control.scaleAngleEnd=200;
control.targetValue=120;
control.minorUnit=15;
control.majorUnit=30;