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

Setting the ZIndex for CartesianPlotBandAnnotation while using AnnotationsProvider

2 Answers 66 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 16 Jul 2018, 04:29 PM

I am using the following AnnotationsProvider to generate annotations using data bindings:

<code>
<telerik:RadCartesianChart.AnnotationsProvider>

                                            <telerik:ChartAnnotationsProvider Source="{Binding LocationHistory}">
                                                <telerik:ChartAnnotationDescriptor>
                                                    <telerik:ChartAnnotationDescriptor.Style>
                                                        <Style TargetType="telerik:CartesianPlotBandAnnotation">
                                                            <Setter Property="Axis" Value="{Binding HorizontalAxis, RelativeSource={RelativeSource AncestorType=telerik:RadCartesianChart}}" />
                                                            <Setter Property="From" Value="{Binding Item2}" />
                                                            <Setter Property="To" Value="{Binding Item3}" />
                                                            <Setter Property="Fill" Value="{Binding Item1, Converter={StaticResource LocationToBrushConverter}}" />
                                                        </Style>
                                                    </telerik:ChartAnnotationDescriptor.Style>
                                                </telerik:ChartAnnotationDescriptor>
                                            </telerik:ChartAnnotationsProvider>
                                        </telerik:RadCartesianChart.AnnotationsProvider>
</code>

I have a bunch of LineSeries elements as well inside the RadCartesianChart element which is the parent of this AnnotationsProvider.

I am trying to get these annotations to render below all the LineSeries elements. But I am unable to set the ZIndex propery through ChartAnnotationDescriptor.Style. Could you please let me know if there is a workaround for this issue?

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 17 Jul 2018, 07:06 AM
Hello Deepak,

You can set the ZIndex property of the annotations like so:
<Setter Property="ZIndex" Value="-10" />
Or alternatively, you can set the Panel.ZIndex attached property.
<Setter Property="Panel.ZIndex" Value="-10" />

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
yoochul
Top achievements
Rank 1
answered on 24 Jun 2019, 05:18 AM

ZIndex property setting in AnnotationsProvider.

but, Panel.ZIdex is not working, Zindex is runtime error

 

Howto Set ZIndex property

 

Tags
ChartView
Asked by
Deepak
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
yoochul
Top achievements
Rank 1
Share this question
or