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

Start Value rounds up

2 Answers 47 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
DeWayne Evans
Top achievements
Rank 1
DeWayne Evans asked on 08 Feb 2010, 04:29 PM
Im in the process of putting together a working sample of gauge controls for a dashboard.
Many of the metrics deal with scales that are very small such as 99.9xx - 100.

This works just fine however my start value is rounded up to 100 when the gauge is rendered. This makes the guage show 100 - 100 for the range which is incorrect.  Is there a way to have the gauge display the actual Min value for the radialScale?

<Grid x:Name="LayoutRoot">  
        <control:RadGauge x:Name="radGauge" Width="300" Height="300">  
            <gauge:RadialGauge> 
                <gauge:RadialScale x:Name="radialScale"  Min="99.90" Max="100" Radius="0.9" StartWidth="0.1" EndWidth="0.15" Background="#44DDCCFF" MajorTickStep=".10" > 
                    <gauge:IndicatorList> 
                        <gauge:Needle x:Name="needle" Value="99.94"/>  
                        <!-- <gauge:RadialBar x:Name="radialBar" Value="99.94" Background="Yellow"/> --> 
                    </gauge:IndicatorList> 
                    <gauge:RangeList> 
                        <gauge:RadialRange    
                          Name="Blue"    
                          Min="99.970"    
                          Max="100"    
                          StartWidth="0.025"    
                          EndWidth="0.035"    
                          Location="Outside"    
                          Background="Blue"    
                          BorderBrush="Blue"    
                          LabelForeground="Blue"/>  
                    </gauge:RangeList> 
                    <gauge:RangeList> 
                        <gauge:RadialRange    
                          Name="Green"    
                          Min="99.960"    
                          Max="99.9699"    
                          StartWidth="0.025"    
                          EndWidth="0.035"    
                          Location="Outside"    
                          Background="Green"    
                          BorderBrush="Green"    
                          LabelForeground="Green"/>  
                    </gauge:RangeList> 
                    <gauge:RangeList> 
                        <gauge:RadialRange    
                          Name="Yellow"    
                          Min="99.940"    
                          Max="99.9599"    
                          StartWidth="0.03"    
                          EndWidth="0.035"    
                          Location="Outside"    
                          Background="Yellow"    
                          BorderBrush="Yellow"    
                          LabelForeground="Yellow"/>  
                    </gauge:RangeList> 
                    <gauge:RangeList> 
                        <gauge:RadialRange    
                          Name="Red"    
                          Min="99.90"    
                          Max="99.9399"    
                          StartWidth="0.03"    
                          EndWidth="0.035"    
                          Location="Outside"    
                          Background="Tomato"    
                          BorderBrush="Tomato"    
                          LabelForeground="Crimson"/>  
                    </gauge:RangeList> 
                    <gauge:RadialScale.Label> 
                        <gauge:LabelProperties Location="Inside" UseRangeColor="True" /> 
                    </gauge:RadialScale.Label> 
                </gauge:RadialScale> 
            </gauge:RadialGauge> 
        </control:RadGauge> 
        
    </Grid> 

Screenshot attached to show.

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 10 Feb 2010, 08:47 AM
Hi,

You can take advantage of the LabelProperties.Format property. Check these examples:

<telerik:RadialScale.Label>
    <telerik:LabelProperties Location="Inside" UseRangeColor="True"  Format="{}{0:F3}"/>
</telerik:RadialScale.Label>

or

<telerik:RadialScale.Label>
    <telerik:LabelProperties Location="Inside" UseRangeColor="True"  Format="{}{0:0.###}"/>
</telerik:RadialScale.Label>


Sincerely,
Ves
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
DeWayne Evans
Top achievements
Rank 1
answered on 11 Feb 2010, 07:21 PM
Thanks this worked out nicely for me.
Tags
Gauge
Asked by
DeWayne Evans
Top achievements
Rank 1
Answers by
Ves
Telerik team
DeWayne Evans
Top achievements
Rank 1
Share this question
or