Start Value rounds up

3 posts, 1 answers
  1. DeWayne Evans
    DeWayne Evans avatar
    3 posts
    Member since:
    Feb 2010

    Posted 08 Feb 2010 Link to this post

    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. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 10 Feb 2010 Link to this post

    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.
  3. DevCraft banner
  4. DeWayne Evans
    DeWayne Evans avatar
    3 posts
    Member since:
    Feb 2010

    Posted 11 Feb 2010 Link to this post

    Thanks this worked out nicely for me.
Back to Top