This is a migrated thread and some comments may be shown as answers.

[Solved] Gauge control customization help

1 Answer 186 Views
Gauge for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Madhan
Top achievements
Rank 1
Madhan asked on 29 Jul 2013, 02:57 PM
Hi Team,

This is Madhan and I am building sample Windows 8 Store Application using Xaml and C#.I would like to change Gauge the control parameters dynamically through the code behind file.

for example I would like to change the BarIndicatorSegment Length value dynamically through the code behind file how can I apply these changes. Please help me.

I tried like this rdscrngMtd1Revenue.Length=70 and also ndlBusiness.Value=80 but it is not working.

<telerikDataViz:RadRadialGauge x:Name="rdscMTDRevenue" Width="140" Height="200" MinValue="0" MaxValue="100" LabelStep="10" Margin="0 40 0 0" TickStep="10" telerikDataViz:RadRadialGauge.MinAngle="-30" telerikDataViz:RadRadialGauge.MaxAngle="210" LabelRadiusScale="1.10">

<telerikDataViz:SegmentedRadialGaugeIndicator x:Name="rdscMTDRevenueTemp" StartValue="0" Value="100">

<telerikDataViz:BarIndicatorSegment Thickness="2" x:Name="rdscrngMtd1Revenue" Stroke="Red" Length="40"/>

<telerikDataViz:BarIndicatorSegment Thickness="2" x:Name="rdscrngMtd2Revenue" Stroke="Yellow" Length="30"/>

<telerikDataViz:BarIndicatorSegment Thickness="2" x:Name="rdscrngMtd3Revenue" Stroke="Green" Length="20"/>

</telerikDataViz:SegmentedRadialGaugeIndicator>

<telerikDataViz:ArrowGaugeIndicator x:Name="ndlBusiness" IsAnimated="True" Value="50" Brush="Gray" Thickness="3" telerikDataViz:RadRadialGauge.IndicatorRadiusScale="0.83"/>

 </telerikDataViz:RadRadialGauge>

Please help me. Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 30 Jul 2013, 04:36 PM
Hello Madhan,

Thank you for your question.

Due to limitations of the WinRT framework, sometimes the names of items in collections cannot be resolved and this is the case with the gauge indicators. Nevertheless, you can access the properties of the indicators through the RadRadialGaude properties, for example here are the steps to access the Length of a BarIndicatorSegment:

  1. The RadRadialGauge has an Indicators property that holds a collection of all indicators currently added to the gauge. You can access the SegmentedRadialGaugeIndicator through this property as you iterate through all items and check their types. 
  2. Then you can access the BarIndicatorSegment collection through the Segments property of the SegmentedRadialGaugeIndicator.
  3. Finally you can change the Length property of the BarIndicatorSegment items.
Analogically, you can access every other property of the gauge indicators. I have also prepared a runnable sample application, based on your code, that demonstrates how you can achieve this in practice.

I hope this was useful and let me know if there is anything else we can help you with.

Regards,
Rositsa Topchiyska
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Gauge for XAML
Asked by
Madhan
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or