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

Text inside State Indicator

3 Answers 31 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 24 Jun 2010, 08:18 AM
I have the following markup but I cannot seem to be able to get the Template correct for displaying the current value of my "averageIndicator" inside the "stateIndicator".  I would like the state indicator to stay the same (the circular-looking shape) but just have some text inside of it.  Is this possible?

<telerikGauges:IndicatorList x:Name="indicators"
    <telerikGauges:Marker x:Name="averageIndicator"  
        Style="{StaticResource LinearMarkerStyle}" 
        Duration="00:00:02" 
        IsAnimated="True" 
        Opacity="0.8" 
        TooltipFormat="{0:0.##}" 
        Value="80" 
        /> 
    <telerikGauges:StateIndicator x:Name="stateIndicator" 
        Left="0.15" 
        Top="0.07" 
        Opacity="0.6" 
        RelativeWidth="0.1" 
        RelativeHeight="0.1" 
        Value="{Binding ElementName=averageIndicator, Path=Value}"
    </telerikGauges:StateIndicator> 
</telerikGauges:IndicatorList> 

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 24 Jun 2010, 01:04 PM
Hi Tim,

The StateIndicator is not designed to show any text inside, but just a color which corresponds to the given value. Still, you can put a simple TextBlock over the scale and show text there.

All the best,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tim
Top achievements
Rank 1
answered on 24 Jun 2010, 03:30 PM
Just to clarify, when you say "over the scale" do you mean above the gauge completely or inside the gauge but overlaying the scale?  Just wondering if you have an example.
0
Andrey
Telerik team
answered on 25 Jun 2010, 11:51 AM
Hello Tim,

The example code with the TextBlock is the following:
<Grid Width="100" Height="300">
    <telerikGauge:RadGauge>
        <telerikGauges:LinearGauge>
            <telerikGauges:LinearScale>
                <telerikGauges:IndicatorList x:Name="indicators">
                    <telerikGauges:Marker x:Name="averageIndicator"
                                          Duration="00:00:02"
                                          IsAnimated="True"
                                          Opacity="0.8"
                                          TooltipFormat="{}{0:0.##}"
                                          Value="80"
                                          />
                    <telerikGauges:StateIndicator x:Name="stateIndicator"
                                                  Left="0.15"
                                                  Top="0.07"
                                                  Opacity="0.6"
                                                  RelativeWidth="0.1"
                                                  RelativeHeight="0.1"
                                                  Value="{Binding ElementName=averageIndicator, Path=Value}">
                    </telerikGauges:StateIndicator>
                </telerikGauges:IndicatorList>
            </telerikGauges:LinearScale>
        </telerikGauges:LinearGauge>
    </telerikGauge:RadGauge>
  
    <TextBlock
        FontWeight="Bold"
        Margin="21,28,29,252"
        Width="50" Height="20">
        <TextBlock.Text>
            <Binding
                ElementName="averageIndicator"
                Path="Value"
                StringFormat="{}{0:F0}"/>
        </TextBlock.Text>
    </TextBlock>
</Grid>

Kind regards,
Andrey Murzov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Gauge
Asked by
Tim
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Tim
Top achievements
Rank 1
Share this question
or