Hello. I try to set ChartAnnotationLabelDefinition.Template in the way where the label of annotation has red color. But I havn't got the required result yet. I wrote the following XAML markup:
<
telerik:RadCartesianChart
Visibility
=
"{Binding IsAbsoluteBarChartVisible}"
>
<!--The definition of an annotation line-->
<
telerik:RadCartesianChart.Annotations
>
<
telerik:CartesianGridLineAnnotation
Axis
=
"{Binding ElementName=verticalAxis}"
Value
=
"{Binding AnnotationValue}"
Label
=
"{Binding AnnotationLabel}"
Stroke
=
"Red"
StrokeThickness
=
"2"
DashArray
=
"8 2"
>
<
telerik:CartesianGridLineAnnotation.LabelDefinition
>
<
telerik:ChartAnnotationLabelDefinition
Location
=
"Inside"
VerticalAlignment
=
"Bottom"
HorizontalAlignment
=
"Center"
>
<!--HERE IS THE TEMPLATE DEFINITION-->
<
telerik:ChartAnnotationLabelDefinition.Template
>
<
DataTemplate
>
<
TextBlock
Foreground
=
"Red"
FontWeight
=
"DemiBold"
/>
</
DataTemplate
>
</
telerik:ChartAnnotationLabelDefinition.Template
>
</
telerik:ChartAnnotationLabelDefinition
>
</
telerik:CartesianGridLineAnnotation.LabelDefinition
>
</
telerik:CartesianGridLineAnnotation
>
</
telerik:RadCartesianChart.Annotations
>
<!-- X axis-->
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<!-- Y axis-->
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
x:Name
=
"verticalAxis"
Title
=
"Децибелы [Дб]"
Minimum
=
"{Binding ChartMinimum}"
Maximum
=
"{Binding ChartMaximum}"
MajorStep
=
"{Binding CurrentStep}"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<!--The chart itself-->
<
telerik:RadCartesianChart.Series
>
<
telerik:BarSeries
ShowLabels
=
"True"
CategoryBinding
=
"Category"
ValueBinding
=
"Value"
ItemsSource
=
"{Binding Data}"
/>
</
telerik:RadCartesianChart.Series
>
</
telerik:RadCartesianChart
>
But when I run my application and navigate to the View where charts are displayed then I see only annotation without label (please see 'AnnotationWithoutLabels.PNG' file attached). When I comment the following part of XAML markup
<
telerik:ChartAnnotationLabelDefinition.Template
>
<
DataTemplate
>
<
TextBlock
Foreground
=
"Red"
FontWeight
=
"DemiBold"
/>
</
DataTemplate
>
</
telerik:ChartAnnotationLabelDefinition.Template
>
then I see annotation with black colored label (please see 'AnnotationWithBlackColoredLabel.PNG' file attached). How do I get a bright red color for the annotation label?