Dundas Data Visualization Support Site
Dundas Support Site Home  |  Contact Us  |  Dundas Home  
Contact Us via Email
Home

Sample - Car Dashboard

 

The Car Dashboard sample (under Gauge Applications → Car Dashboard) demonstrates using the gauge as a dynamic car dashboard. A single data source is used to populate several elements, and the odometer is controlled by calculating the integral of the velocity data.

Point and Figure Chart

The sample's Overview describes the Car Dashboard's architecture and behavior.

The source code snippets demonstrate attaching several elements to the same data source and show how the ValueChanged event is used to keep the odometer element up to date based on the velocity.

C#

using Dundas.Gauges.WinControl;
…

// Set the pointer value using the Values collection.
gaugeContainer1.CircularGauges["Speedometer"].Pointers["Default"].ValueSource = "Velocity";
    
// Set the numeric indicator value using the Values collection.
gaugeContainer1.NumericIndicators["NumericVelocity"].ValueSource = "Velocity";

// Set the value of state indicator for Gear #1 using the Values collection.
// All other state indicators on the dashboard can be set in the same way.
gaugeContainer1.StateIndicators["Gear1"].ValueSource = "Velocity";

…

// The ValueChanged event occurs when there is a change in the value of 
// any Input Value contained in the Values collection.      
private void gaugeContainer1_ValueChanged(object sender, Dundas.Gauges.WinControl.ValueChangedEventArgs e) {
    …
}

VisualBasic.NET

Imports Dundas.Gauges.WinControl
…

' Set the pointer value using the Values collection.
gaugeContainer1.CircularGauges("Speedometer").Pointers("Default").ValueSource = "Velocity"
 
' Set the numeric indicator value using the Values collection.
gaugeContainer1.NumericIndicators("NumericVelocity").ValueSource = "Velocity"
 
' Set the value of state indicator for Gear #1 using the Values collection.
' All other state indicators on the dashboard can be set in the same way.
gaugeContainer1.StateIndicators("Gear1").ValueSource = "Velocity"

…

' The ValueChanged event occurs when there is a change in the value of 
' any Input Value contained in the Values collection.
Private  Sub gaugeContainer1_ValueChanged(ByVal sender As Object, 
    ByVal e As Dundas.Gauges.WinControl.ValueChangedEventArgs) Handles gaugeContainer1.ValueChanged
    …
End Sub
PoorExcellent