Hi I am busy converting a asp.net dashboard to silverlight, especially the visual components. AM struggling a bit with binding data to the circular "Needle" Gauge as well as the circular "Radialbar" gauge. These are my XAML Setups for the two:
<telerik:RadRadialGauge Name="radialGauge"
Width="300"
Height="300"
Background="Azure" Margin="286,29,214,123">
<telerik:RadialScale Name="scale"
Min="0"
Max="30"
LabelOffset="0.05*"
LabelRotationMode="None"
LabelFormat="{}{0}" Foreground="Red" Background="Orange">
<telerik:RadialScale.Indicators>
<telerik:Needle Name="needle1" Background="DarkBlue" IsAnimated="True" RefreshMode="Average"
IsEnabled="True" Visibility="Visible" />
<telerik:Pinpoint Background="RosyBrown" />
</telerik:RadialScale.Indicators>
<telerik:RadialScale.Ranges>
<telerik:GaugeRange Background="#FFA3A3A3"
Min="0" Max="10" />
<telerik:GaugeRange Background="#FF000000"
Min="10" Max="20" />
<telerik:GaugeRange Background="#FFE50000"
Min="20" Max="30" />
</telerik:RadialScale.Ranges>
</telerik:RadialScale>
</telerik:RadRadialGauge>
<telerik:RadRadialGauge Width="200" Height="200" telerik:StyleManager.Theme="Windows8" Name="Bar" Margin="44,155,556,97" IsEnabled="True" Visibility="Visible">
<telerik:RadialScale>
<telerik:RadialScale.Ranges>
<telerik:GaugeRange Min="0" Max="25"
StartWidth="0.05"
EndWidth="0.05"
Background="Blue"
TickBackground="Blue"
LabelForeground="Blue"
IndicatorBackground="Blue" />
<telerik:GaugeRange Min="25" Max="50"
StartWidth="0.05"
EndWidth="0.05"
Background="SkyBlue"
TickBackground="SkyBlue"
LabelForeground="SkyBlue"
IndicatorBackground="SkyBlue" />
<telerik:GaugeRange Min="50" Max="75"
StartWidth="0.05"
EndWidth="0.05"
Background="Green"
TickBackground="Green"
LabelForeground="Green"
IndicatorBackground="Green" />
<telerik:GaugeRange Min="75" Max="100"
StartWidth="0.05"
EndWidth="0.05"
Background="Yellow"
TickBackground="Yellow"
LabelForeground="Yellow"
IndicatorBackground="Yellow" />
</telerik:RadialScale.Ranges>
<telerik:RadialScale.Indicators>
<telerik:BarIndicator Name="radialBar"
UseRangeColor="True"
RangeColorMode="Default"
/>
</telerik:RadialScale.Indicators>
</telerik:RadialScale>
</telerik:RadRadialGauge>
And then I bind my data in the code behind:
Me.needle1.Value = e.Result
Me.radialBar.ValueSource = e.Result
The MS SQl Query I bind to is a simple count statement:
Select count(*) as TotC from Table
The return value is supposed to be "7"
Regards and thank You
<telerik:RadRadialGauge Name="radialGauge"
Width="300"
Height="300"
Background="Azure" Margin="286,29,214,123">
<telerik:RadialScale Name="scale"
Min="0"
Max="30"
LabelOffset="0.05*"
LabelRotationMode="None"
LabelFormat="{}{0}" Foreground="Red" Background="Orange">
<telerik:RadialScale.Indicators>
<telerik:Needle Name="needle1" Background="DarkBlue" IsAnimated="True" RefreshMode="Average"
IsEnabled="True" Visibility="Visible" />
<telerik:Pinpoint Background="RosyBrown" />
</telerik:RadialScale.Indicators>
<telerik:RadialScale.Ranges>
<telerik:GaugeRange Background="#FFA3A3A3"
Min="0" Max="10" />
<telerik:GaugeRange Background="#FF000000"
Min="10" Max="20" />
<telerik:GaugeRange Background="#FFE50000"
Min="20" Max="30" />
</telerik:RadialScale.Ranges>
</telerik:RadialScale>
</telerik:RadRadialGauge>
<telerik:RadRadialGauge Width="200" Height="200" telerik:StyleManager.Theme="Windows8" Name="Bar" Margin="44,155,556,97" IsEnabled="True" Visibility="Visible">
<telerik:RadialScale>
<telerik:RadialScale.Ranges>
<telerik:GaugeRange Min="0" Max="25"
StartWidth="0.05"
EndWidth="0.05"
Background="Blue"
TickBackground="Blue"
LabelForeground="Blue"
IndicatorBackground="Blue" />
<telerik:GaugeRange Min="25" Max="50"
StartWidth="0.05"
EndWidth="0.05"
Background="SkyBlue"
TickBackground="SkyBlue"
LabelForeground="SkyBlue"
IndicatorBackground="SkyBlue" />
<telerik:GaugeRange Min="50" Max="75"
StartWidth="0.05"
EndWidth="0.05"
Background="Green"
TickBackground="Green"
LabelForeground="Green"
IndicatorBackground="Green" />
<telerik:GaugeRange Min="75" Max="100"
StartWidth="0.05"
EndWidth="0.05"
Background="Yellow"
TickBackground="Yellow"
LabelForeground="Yellow"
IndicatorBackground="Yellow" />
</telerik:RadialScale.Ranges>
<telerik:RadialScale.Indicators>
<telerik:BarIndicator Name="radialBar"
UseRangeColor="True"
RangeColorMode="Default"
/>
</telerik:RadialScale.Indicators>
</telerik:RadialScale>
</telerik:RadRadialGauge>
And then I bind my data in the code behind:
Me.needle1.Value = e.Result
Me.radialBar.ValueSource = e.Result
The MS SQl Query I bind to is a simple count statement:
Select count(*) as TotC from Table
The return value is supposed to be "7"
Regards and thank You