How do i make a label inside a gauge?

2 posts, 0 answers
  1. Robert
    Robert avatar
    8 posts
    Member since:
    Apr 2009

    Posted 09 Jul 2009 Link to this post

    I want to put a label with the unit inside my gauge, for example "C°", that is on the same place if i resize the gauge. How do i do?
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 10 Jul 2009 Link to this post

    Hello Robert,

    You can use the custom tick mark to display a label that will be placed relatively to a scale.
    The examples below demonstrate the "°C" label on radial and linear scales.
    You can change the Value, Location and Offset properties of the CustomTickMark element to place the label as you want.

    <telerik:RadialScale> 
        <telerik:TickList> 
            <telerik:CustomTickMark Value="-10" 
                                    Location="CenterInside" 
                                    Offset="0.01">  
                <telerik:CustomTickMark.Template> 
                    <ControlTemplate> 
                        <ContentPresenter> 
                            <ContentPresenter.Content> 
                                <Canvas> 
                                    <TextBlock FontWeight="Bold" 
                                               FontSize="14" 
                                               Foreground="White" 
                                               Text="°C"/>  
                                </Canvas> 
                            </ContentPresenter.Content> 
                        </ContentPresenter> 
                    </ControlTemplate> 
                </telerik:CustomTickMark.Template> 
                <telerik:CustomTickMark.ItemTemplate> 
                    <DataTemplate /> 
                </telerik:CustomTickMark.ItemTemplate> 
            </telerik:CustomTickMark> 
        </telerik:TickList> 
    </telerik:RadialScale> 
     

    <telerik:LinearScale> 
        <telerik:TickList> 
            <telerik:CustomTickMark Value="-7" 
                                    Location="Inside" 
                                    Offset="-0.02">  
                <telerik:CustomTickMark.Template> 
                    <ControlTemplate> 
                        <ContentPresenter> 
                            <ContentPresenter.Content> 
                                <Canvas> 
                                    <TextBlock HorizontalAlignment="Center" 
                                               FontWeight="Bold" 
                                               FontSize="14" 
                                               Foreground="White" 
                                               Text="°C"/>  
                                </Canvas> 
                            </ContentPresenter.Content> 
                        </ContentPresenter> 
                    </ControlTemplate> 
                </telerik:CustomTickMark.Template> 
                <telerik:CustomTickMark.ItemTemplate> 
                    <DataTemplate /> 
                </telerik:CustomTickMark.ItemTemplate> 
            </telerik:CustomTickMark> 
        </telerik:TickList> 
    </telerik:LinearScale> 
     


    Sincerely yours,
    Andrey Murzov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top