Secondary Y-Axis for Chart

3 posts, 1 answers
  1. Dts
    Dts avatar
    12 posts
    Member since:
    Apr 2013

    Posted 26 Sep 2013 Link to this post

    Hello,
            I can add secondary y-axis to my chart.Currently the chart has secondary Y-axis equals to the number of series aligned to that axis.
    But our requirement is to have only one secondary Y axis should be configured to the all the series which have  aligned to that secondary Y axis.In short, I would like to have only one secondary Y-axis to right for multiple series and it should configure scale automatically on that axis according to series values. Just like we have primary vertical  Y  on Left axis  which scales automatically for any multiple number of series.
    Is it possible to assign the same primary Vertical Y  on Right axis for any number of series?
    I have gone through the documentation of shared vertical axis here http://www.telerik.com/help/wpf/radchartview-axes-multipleaxes.html
    but we have dynamic multiple series and we are adding series to the chart dynamically.So how do i set the secondary vertical axis?.Currently I have set it to for every series and that's why multiple vertical axes are getting added.   
     
    Could you please help me to resolve this issue if it is possible to implement.
    Thank You in Advance  
  2. Answer
    Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 01 Oct 2013 Link to this post

    Hi Dts,

    Here's an example of using a shared vertical axis in code-behind:
    var chart = new RadCartesianChart();
    //The primary vertical axis:
    chart.VerticalAxis = new LinearAxis();
    chart.HorizontalAxis = new CategoricalAxis();
     
    var secondaryVAxis = new LinearAxis();
     
    //Uses the primary V axis:
    chart.Series.Add(new LineSeries());
     
    //the next 3 series use the
    //secondary axis:
    chart.Series.Add(new BarSeries()
    {
        VerticalAxis = secondaryVAxis
    });
    chart.Series.Add(new RangeSeries()
    {
        VerticalAxis = secondaryVAxis
    });
    chart.Series.Add(new AreaSeries()
    {
        VerticalAxis = secondaryVAxis
    });
     
    I hope this helps.

    Regards,
    Petar Kirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dts
    Dts avatar
    12 posts
    Member since:
    Apr 2013

    Posted 17 Oct 2013 Link to this post

    Thank you for your reply. Given solution is working fine.
Back to Top