180% Radial gauge. Low Max numbers

4 posts, 0 answers
  1. mark reed
    mark reed avatar
    3 posts
    Member since:
    Nov 2009

    Posted 20 Nov 2009 Link to this post

    I'm brand new to this product so forgive my ignorance :)

    I'm trying to create a 180% where the Max value is a low number like 3. When I do this the majorticks go something like this 0 0 0 1 1 1 2 2 2.

    Does anyone know how to make it like this .25 .50 .75 1 1.25 1.50 2.75 3.0 etc....?
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 25 Nov 2009 Link to this post

    Hello mark reed,

    You can achieve the desired effect by setting RadialScale.MajorTickStep="0.25" and on RadialScale.Label -- Format="{}{0:n2}" like this:

    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary
                            Source="/Telerik.Windows.Controls.Gauge;component/Themes/Generic.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Grid.Resources>
         
        <control:RadGauge x:Name="radGauge">
            <gauge:RadialGauge x:Name="radialGauge"
                               Style="{StaticResource RadialGaugeHalfCircleNStyle}">
                <gauge:RadialScale x:Name="radialScale" Min="0" Max="3" MajorTickStep="0.25"
                                   Style="{StaticResource RadialScaleHalfCircleNStyle}">
                    <gauge:RadialScale.MajorTick>
                        <gauge:MajorTickProperties />
                    </gauge:RadialScale.MajorTick>
                    <gauge:RadialScale.MiddleTick>
                        <gauge:MiddleTickProperties Length="0.05" TickWidth="0.2" />
                    </gauge:RadialScale.MiddleTick>
                    <gauge:RadialScale.MinorTick>
                        <gauge:MinorTickProperties Length="0.03" TickWidth="0.3" />
                    </gauge:RadialScale.MinorTick>
                    <gauge:RadialScale.Label>
                        <gauge:LabelProperties Format="{}{0:n2}" />
                    </gauge:RadialScale.Label>
                    <gauge:IndicatorList>
                        <gauge:Needle x:Name="needle"
                                      IsAnimated="True"
                                      Value="65"/>
                    </gauge:IndicatorList>
                </gauge:RadialScale>
            </gauge:RadialGauge>
        </control:RadGauge>
    </Grid>


    Hope this helps.


    Greetings,
    Manuel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. mark reed
    mark reed avatar
    3 posts
    Member since:
    Nov 2009

    Posted 27 Nov 2009 Link to this post

    Yes it does help however now I am stuck trying to go the other way.

    I want to make 4,000,000 become 4m or 4,500,000 become 4.5m and 4,000 become 4k.

    Is there anyway to do that? I've tried passing things like {#,}:{}k or {0,,}:{}m

    Thanks
  4. mark reed
    mark reed avatar
    3 posts
    Member since:
    Nov 2009

    Posted 27 Nov 2009 Link to this post

    Nevermind I figured it out.
    {0:#,}k
Back to Top