I would like to add some static text to the Comparative Measure element. I have re-templated the bullet graph, but my attempts to add the text does not seem to work. I would like the text to float at the top right of the line. Is this possible?
Here is my style template:
<Style x:Key="RadHorizontalBulletGraphStyle" TargetType="telerik:RadHorizontalBulletGraph"> <Setter Property="ComparativeMeasureThickness" Value="1"/> <Setter Property="FontSize" Value="10"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="telerik:RadHorizontalBulletGraph"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="5*"/> <RowDefinition Height="5*"/> </Grid.RowDefinitions> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" Grid.Row="0"> <Grid> <Grid> <Grid.Resources> <Style TargetType="telerik:BarItem"> <Setter Property="LengthPercent" Value="1" /> </Style> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="5*" /> <RowDefinition Height="5*" /> </Grid.RowDefinitions> <telerik:FeaturedMeasurePresenter Grid.Row="0" Content="{TemplateBinding FeaturedMeasureInternal}" Margin="0,5" /> <telerik:FeaturedMeasurePresenter Grid.Row="1" Content="{TemplateBinding ProjectedMeasureInternal}" Margin="0,5" /> </Grid> <StackPanel HorizontalAlignment="Stretch"> <telerik:ComparativeMeasuresContainer ChildrenSource="{TemplateBinding MergedComparativeMeasures}" Range="{TemplateBinding Range}" Margin="-15" /> </StackPanel> </Grid> </Border> <telerik:QuantitativeScaleContainer Grid.Row="1" TextFormatString="{TemplateBinding TextFormatString}" Visibility="{TemplateBinding QuantitativeScaleVisibility}" Opacity="0.5" RenderTransformOrigin="0.5,0.5" Range="{TemplateBinding Range}" > <telerik:QuantitativeScaleContainer.RenderTransform> <TranslateTransform Y="5"/> </telerik:QuantitativeScaleContainer.RenderTransform> </telerik:QuantitativeScaleContainer> </Grid> </ControlTemplate> </Setter.Value> </Setter></Style><SolidColorBrush x:Key="ActualBrush" Color="Green" /><SolidColorBrush x:Key="TargetBrush" Color="Red" />And here is my control definition:
<telerik:RadHorizontalBulletGraph TextFormatString="${0}" ProjectedValue="150" FeaturedMeasure="200" ComparativeMeasure="175" Height="100" Style="{StaticResource RadHorizontalBulletGraphStyle}" FeaturedMeasureBrush="{StaticResource ActualBrush}" ProjectedValueBrush="{StaticResource TargetBrush}" Step="200" />