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

[Solved] Text inside gauge windows 8.1 app

1 Answer 62 Views
Gauge for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ahmet
Top achievements
Rank 1
Ahmet asked on 18 Sep 2014, 03:54 PM
I am trying out Telerik UI for Windows 8.1 xaml toolkit. And what I'm trying to accomplish is "placing a text an the center of gauge".
There are examples of this specific need covering "UI for WPF" referring a solution through "RadialScale.CustomItems". Which doesn't exist in UI for Windows 8.1.

ıs there another property that will work for me or at least a workaround?
I hope u can suggest me a solution.

Ahmet

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 23 Sep 2014, 02:45 PM
Hi Ahmet,

You can just place a TextBlock over the gauge. You can find an example of this in our FirstLook example, available on your computer in a folder like this:

C:\Program Files (x86)\Telerik\UI for Windows 8.1 XAML Q2 2014\Demos\Examples\Gauge\Gallery

Check the Gauge1.xaml file in Templates folder. Here's part of the xaml:

<Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Text="EXPENSES(% OF TARGET)" FontSize="12" HorizontalAlignment="Center"></TextBlock>
                <telerikDataViz:RadRadialGauge MaxValue="120" LabelStep="60" Margin="0 30 0 0" TickStep="20" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" LabelRadiusScale="1.10">
                     
                    <telerikDataViz:RadRadialGauge.LabelTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" FontSize="15" Foreground="Red" Margin="0,0,0,10"></TextBlock>
                        </DataTemplate>
                    </telerikDataViz:RadRadialGauge.LabelTemplate>
                    <telerikDataViz:SegmentedRadialGaugeIndicator StartValue="0" Value="120">
                        <telerikDataViz:BarIndicatorSegment Thickness="2" Stroke="#595959" Length="40"/>
                        <telerikDataViz:BarIndicatorSegment Thickness="2" Stroke="Black" Length="40"/>
                        <telerikDataViz:BarIndicatorSegment Thickness="2" Stroke="Red" Length="40"/>
                    </telerikDataViz:SegmentedRadialGaugeIndicator>
                    <telerikDataViz:RadialBarGaugeIndicator IsAnimated="True" Value="{Binding ExpensePercent}" Brush="Black" Thickness="12" telerikDataViz:RadRadialGauge.IndicatorRadiusScale="0.83"/>
                    <telerikDataViz:MarkerGaugeIndicator Value="99" Content="*" FontFamily="Segoe UI" FontSize="17" Foreground="#595959" telerikDataViz:RadRadialGauge.IndicatorRadiusScale="0.83"/>
                </telerikDataViz:RadRadialGauge>
                <TextBlock Text="{Binding ExpensePercent}" FontSize="15" Grid.Row="1" Margin="0,30,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
            </Grid>


Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Gauge for XAML
Asked by
Ahmet
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or