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

Secondary Y-Axis for Chart

2 Answers 207 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Dts
Top achievements
Rank 1
Dts asked on 26 Sep 2013, 11:04 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 01 Oct 2013, 11:49 AM
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 >>
0
Dts
Top achievements
Rank 1
answered on 17 Oct 2013, 07:03 AM
Thank you for your reply. Given solution is working fine.
Tags
ChartView
Asked by
Dts
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Dts
Top achievements
Rank 1
Share this question
or