Issue with marked zone annotation referring to secondary axes

3 posts, 0 answers
  1. Paolo
    Paolo avatar
    4 posts
    Member since:
    Jan 2013

    Posted 21 Feb 2013 Link to this post

    Good morning, in my project I have to refer marked zone annotations to a secondary Y axes, but it does not seem to work.
    Project involves complex logic with the MVVM pattern, in order to try to understand what is going on I made up a simple example (below), but still does not work. Marked zone annotation must be referred to secondary Y Axes, called "Height", but still refers to the primary one.
    Please tell me what am I missing,
       Paolo



    <telerikChart:RadChart x:Name="radChart">
                    <telerikChart:RadChart.DefaultView>
                        <telerikCharting:ChartDefaultView>
                            <telerikCharting:ChartDefaultView.ChartLegend>
                                <telerikCharting:ChartLegend x:Name="chartLegend2" Header="Legend" UseAutoGeneratedItems="True" Visibility="Collapsed"/>
                            </telerikCharting:ChartDefaultView.ChartLegend>
                            <telerikCharting:ChartDefaultView.ChartArea>
                                <telerikCharting:ChartArea LegendName="chartLegend">
                                    <telerikCharting:ChartArea.AxisX>
                                        <telerikCharting:AxisX
                                            AutoRange="False"
                                            MajorGridLinesVisibility="Visible"
                                            MinValue="0"
                                            MaxValue="20"
                                            Step="2"
                                            ></telerikCharting:AxisX>
                                    </telerikCharting:ChartArea.AxisX>
                                    <telerikCharting:ChartArea.AxisY>
                                        <telerikCharting:AxisY
                                            AutoRange="False"
                                            MinorGridLinesVisibility="Hidden"
                                            MajorGridLinesVisibility="Visible"
                                            MinorTicksVisibility="Hidden"
                                            StripLinesVisibility="Hidden"
                                            MinValue="0"
                                            MaxValue="1000"
                                            Step="100"
                                            >
                                        </telerikCharting:AxisY>
                                    </telerikCharting:ChartArea.AxisY>
                                    <telerikCharting:ChartArea.AdditionalYAxes>
                                        <telerikCharting:AxisY x:Name="Height"
                                                                    AutoRange="False"
                                                                    MinValue="0"
                                                                    MaxValue="10"
                                                                    Step="1"
                                                                    MinorTicksVisibility="Hidden"
                                                                    Visibility="Visible"
                                                                    >
                                        </telerikCharting:AxisY>
                                    </telerikCharting:ChartArea.AdditionalYAxes>
                                    
                                    <telerikCharting:ChartArea.Annotations>
                                        <telerikCharting:MarkedZone
                                            YAxisName="Height"
                                            StartX="6"
                                            EndX="8"
                                            StartY="3"
                                            EndY="7"
                                            Background="Orange"
                                            >
                                        </telerikCharting:MarkedZone>
                                    </telerikCharting:ChartArea.Annotations>
                                    
                                    <telerikCharting:ChartArea.DataSeries>
                                        <!-- Line Chart -->
                                        <telerikCharting:DataSeries LegendLabel="Product Sales">
                                            <telerikCharting:DataSeries.Definition>
                                                <telerikCharting:LineSeriesDefinition>
                                                </telerikCharting:LineSeriesDefinition>
                                            </telerikCharting:DataSeries.Definition>
                                            <telerikCharting:DataPoint YValue="112" XValue="0"/>
                                            <telerikCharting:DataPoint YValue="257" XValue="2"/>
                                            <telerikCharting:DataPoint YValue="450" XValue="4"/>
                                            <telerikCharting:DataPoint YValue="800" XValue="6"/>
                                            <telerikCharting:DataPoint YValue="467" XValue="8"/>
                                            <telerikCharting:DataPoint YValue="469" XValue="10"/>
                                            <telerikCharting:DataPoint YValue="540" XValue="12"/>
                                            <telerikCharting:DataPoint YValue="560" XValue="14"/>
                                            <telerikCharting:DataPoint YValue="500" XValue="16"/>
                                            <telerikCharting:DataPoint YValue="235" XValue="18"/>
                                            <telerikCharting:DataPoint YValue="76"  XValue="20"/>
                                        </telerikCharting:DataSeries>
                                    </telerikCharting:ChartArea.DataSeries>
                                </telerikCharting:ChartArea>
                            </telerikCharting:ChartDefaultView.ChartArea>
                        </telerikCharting:ChartDefaultView>
                    </telerikChart:RadChart.DefaultView>
                </telerikChart:RadChart>
  2. Missing user
    Missing user avatar

    Posted 26 Feb 2013 Link to this post

    Hello Paolo,

    The MarkedZone YAxisName property doesn't refer to the x:Name of the additional Y-Axis. Rather, it refers to the AxisName property of that axis. You only have to replace
    <telerik:AxisY x:Name="Height"/>
    with
    <telerik:AxisY AxisName="Height"/>

    Then, the annotation will appear as expected.

    Greetings,
    Ivan N.
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Paolo
    Paolo avatar
    4 posts
    Member since:
    Jan 2013

    Posted 06 Mar 2013 Link to this post

    Thank you so much!
Back to Top