We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Questions on changing Gauge programmatically

I have the following in XAML

<Gauges:SfCircularGauge x:Name="RateGauge" Height="200" Width="200" HorizontalAlignment="Right" Grid.Row="0">
                            <Gauges:SfCircularGauge.MainScale>
                                <Gauges:CircularScale x:Name="RateGaugeScale" StartValue="0" EndValue="16" Interval="1" LabelStroke="OrangeRed" TickStroke="OrangeRed" EnableSmartLabels="True">
                                    <Gauges:CircularScale.Ranges>
                                        <Gauges:CircularRange StartValue="0" EndValue="5" Stroke="Red"/>
                                        <Gauges:CircularRange StartValue="5" EndValue="8" Stroke="Yellow"/>
                                        <Gauges:CircularRange StartValue="8" EndValue="16" Stroke="Green"/>
                                    </Gauges:CircularScale.Ranges>
                                    <Gauges:CircularScale.Pointers>
                                        <Gauges:CircularPointer x:Name="RateRangePointer" PointerType="RangePointer" RangePointerStroke="OrangeRed" EnableAnimation="True" RangePointerStrokeThickness="10" />
                                        <Gauges:CircularPointer x:Name="RateNeedlePointer" PointerType="NeedlePointer" NeedlePointerStroke="OrangeRed" EnableAnimation="True"/>
                                    </Gauges:CircularScale.Pointers>
                                </Gauges:CircularScale>
                            </Gauges:SfCircularGauge.MainScale>
                        </Gauges:SfCircularGauge>

My Gauge End Value is variable, so I need to ranges to be variable as well. so how do I create the above ranges programmatically

Secondly, I am trying to update my pointers programmatically, I want it to count down from the highest value to 0, but when I try to set the Value for the pointer I get a Null Reference Exception.

3 Replies

JO Joy Oyiess Rex  K Syncfusion Team April 1, 2014 12:37 PM UTC

Hi Bobby,

 

Thanks for your interest in Syncfusion Products.

 

We are currently analysing on this, we will let you know the detail in two business days (Apr 3, 2014)

 

Please let us know, if you need any further assistance.

 

Regards,

Joy Oyiess Rex K



BH Bobby Harrell April 1, 2014 03:31 PM UTC

I figured this one out, thank you

CircularRange range = new CircularRange()

also I had to progmatically create the Needle in order to be able to update it progmatically, but It is all working now.. THanks you


JO Joy Oyiess Rex  K Syncfusion Team April 2, 2014 12:22 PM UTC

Hi Bobby,

 

We are glad that the issue resolved at you end itself.

 

Please let us know, if you need any further assistance.

 

Regards,

Joy Oyiess Rex K


Loader.
Live Chat Icon For mobile
Up arrow icon