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

How do i make a label inside a gauge?

1 Answer 132 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 Jul 2009, 09:56 AM
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?

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 10 Jul 2009, 08:20 AM
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.
Tags
Gauges
Asked by
Robert
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or