Hi,
I do have a RadCartesianChart inside a DataTemplate which does not show its defined Annotations (VerticalAxis' x:name is set and referred from the Annotations) . The same RadCartesianChart worked fine outside the DataTemplate on a project test, showing all the Annotations. I don't know what is happening, I suppose it's something I missed but I can't see what it is.
Code:
<telerik:RadCartesianChart Grid.Column="1"
view:ChartSeriesProviderBehavior.Series="{Binding Path=VisibleSeries}"
>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis IsInverse="True" GapLength="0.14" LabelFitMode="Rotate" LabelRotationAngle="45" LabelFormat="dd MMM yyyy" Minimum="{Binding Path=Min}" Maximum="{Binding Path=Max}" />
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis x:Name="verticalAxis" />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Annotations>
<telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Value="2" Stroke="Red" StrokeThickness="1"/>
<telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Value="13" Stroke="Red" StrokeThickness="1"/>
</telerik:RadCartesianChart.Annotations>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal" />
<telerik:ChartTooltipBehavior Placement="Top" VerticalOffset="0" />
</telerik:RadCartesianChart.Behaviors>
</telerik:RadCartesianChart>
Thanks for your help!
I do have a RadCartesianChart inside a DataTemplate which does not show its defined Annotations (VerticalAxis' x:name is set and referred from the Annotations) . The same RadCartesianChart worked fine outside the DataTemplate on a project test, showing all the Annotations. I don't know what is happening, I suppose it's something I missed but I can't see what it is.
Code:
<telerik:RadCartesianChart Grid.Column="1"
view:ChartSeriesProviderBehavior.Series="{Binding Path=VisibleSeries}"
>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis IsInverse="True" GapLength="0.14" LabelFitMode="Rotate" LabelRotationAngle="45" LabelFormat="dd MMM yyyy" Minimum="{Binding Path=Min}" Maximum="{Binding Path=Max}" />
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis x:Name="verticalAxis" />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Annotations>
<telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Value="2" Stroke="Red" StrokeThickness="1"/>
<telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Value="13" Stroke="Red" StrokeThickness="1"/>
</telerik:RadCartesianChart.Annotations>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal" />
<telerik:ChartTooltipBehavior Placement="Top" VerticalOffset="0" />
</telerik:RadCartesianChart.Behaviors>
</telerik:RadCartesianChart>
Thanks for your help!