Multiple Y-axis: Can two ChartSeries share one custom Y-axis?

I am trying the WPF chart control.
From the sample code, it looks like each custom Y-axis can only be used by one ChartSeries. The axis is actually define inside the ChartSeries definition.

Can I do something like:

Left Y-axis: Depth
Right Y-axis: Speed

ChartSeries 1: Depth
ChartSeries 2: Speed
ChartSeries 3: Speed ?

Thanks,

JW

1 Reply

MP Murugavel P Syncfusion Team April 12, 2010 05:26 AM UTC

Hi,

Thanks for choosing Syncfusion products.

You can initialize the Custom Y-Axis to multiple chart series by using the following lines of code.

C#:

//Initialize Speed Y-Axis. This is Custom Y-Axis Will be initializing Chart series.
ChartAxis Speed = new ChartAxis();
Speed.Header = "Speed";
Speed.Orientation = Orientation.Vertical;
Speed.OpposedPosition = true;


//Initialize the second chart series with Y-Axis as Speed.
ChartSeries series2 = new ChartSeries();
series2.Data = converter.ConvertFromString("1,50,2,70,3,80,4,40,6,50") as ChartListData;
series2.YAxis = Speed;

//Initialize the third chart series with Y-Axis as Speed.
ChartSeries series3 = new ChartSeries();
series3.Data = converter.ConvertFromString("1,85,2,100,3,50,4,70,6,90") as ChartListData;
series3.YAxis = Speed;


I have implemented simple sample based on your requirement. Please download sample from the following location.

http://help.syncfusion.com/support/Chart.WPF/8.1.0.30/Forum/93869/CustomY-Axis.zip


Please let us know if you have any questions.

Thanks
Murugavel

Loader.
Up arrow icon