Move the Needle Marker Automatically
This topic explains how you can configure the needle on your Radial gauge to move automatically. For example, if you created a Radial gauge to represent a clock, you could configure the hands of the clock to move automatically, giving the impression of a real-time clock.
To move the needle marker automatically on your gauge:
-
In the Properties window, set the RefreshInterval property to 10 seconds. This fires AsyncRefresh event on the server at each of these intervals.
-
The following example code accesses the needle marker on your Radial gauge and increases the value by 5.
Protected Sub UltraGauge1_AsyncRefresh(ByVal sender As Object, _
ByVal e As Infragistics.WebUI.UltraWebGauge.RefreshEventArgs) _
Handles UltraGauge1.AsyncRefresh
Dim gauge As RadialGauge = Me.UltraGauge1.Gauges(0)
Dim marker As RadialGaugeMarker = gauge.Scales(0).Markers(0)
Dim value As Integer = Convert.ToInt32(marker.Value)
marker.Value = value + 5
End Sub
protected void UltraGauge1_AsyncRefresh(object sender,
Infragistics.WebUI.UltraWebGauge.RefreshEventArgs e)
{
RadialGauge gauge = this.UltraGauge1.Gauges[0] as RadialGauge;
RadialGaugeMarker marker = gauge.Scales[0].Markers[0];
int value = Convert.ToInt32(marker.Value);
marker.Value = value+5;
}
-
Save and run the application.