We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Multiple axis

Hi

How can we add individual Yaxis for each series. in my project i have total 10 series and i want to add individual Yaxis for each series on selected checkbox, currently all sereis are sharing same axis.

code:


ChartSeries seriesChart = new ChartSeries();
chart.Areas[0].Series.Add(seriesChart);
seriesChart.XAxis = axisX;
seriesChart.YAxis = axisY;
seriesChart.DataSource = Outputset.Output_graph_tuples;
seriesChart.BindingPathX = "X_value";
seriesChart.BindingPathsY = new string[] { series.Datafieldname };
seriesChart.Label = series.Graphname;
seriesChart.StrokeThickness = 3;

Yuvraj


8 Replies

PJ Pavithra J Syncfusion Team December 23, 2008 12:09 PM UTC

Hi Yuvraj,

Thanks for your interest in Syncfusion products.

For each and every series in a chart, it is possible to create a seperate X and Y axis.

Since your requirement is just adding multiple secondary axis you can make use of the property YAxis of ChartSeries class. For your reference I have created a sample that could be downloaded from the below given link

http://websamples.syncfusion.com//samples/WPF/F78662/MultipleAxes.zip

Please let me know if you have any queries.

Thanks,
Pavithra.J



AD Administrator Syncfusion Team December 24, 2008 03:52 AM UTC

Hi,

Thanks a lot its working Very well.

I wondering like when we unselect checkbox can we remove legend along with Yaxis.

and also i am not show gridline in my chart, what could be problem.i tried showgridline== true; its not working.






SA Saradha Syncfusion Team December 24, 2008 11:36 AM UTC

Hi Yuvraj,

1. Legend Items of the corresponding series will be removed only when the series is removed. But here we are just hiding the series.

However your requirement can be achieved by applying a custom DataTemplate to ItemsTemplate property of ChartLegend class. This is illustrated in the attached sample.

2. On setting the ShowGridLines property the axis is supposed to show the GridLines. In the attached sample you could see the GridLines visible for Primary Axis and invisible for Secondary Axis. Could you please check with the attached sample whether the code used in your side is proper.

I have modified the multiple axes sample and it is attached for your reference.

Please let us know if you have further queries.

Regards,
K. Saradha Devi.



MultipleAxes_WithLegendItemsRemoved_f0f8b5.zip


AD Administrator Syncfusion Team December 28, 2008 11:12 PM UTC

Hi ,

Thanks a lot again

But regarding gridline its still not working , i have no idea why it is doing this. What could be possibl problem causing this???

My code :
x:Name="chartArea"
Background="Transparent">















AD Administrator Syncfusion Team December 29, 2008 01:00 AM UTC

Hi

I have solved displaying gridline problem, now onemore problem has occured, I have 10 series and its displaying grid line for all ten its kinda looks mess, so is there any possible way of displying common grid line for all .

please have a look at image file for clear idea of my problem.

Thanks

Yuvraj



grid_28ad8792.zip


PJ Pavithra J Syncfusion Team December 29, 2008 12:16 PM UTC

Hi Yuvraj,

Thanks for your interest in Syncfusion products.

The GridLines of any particular series will be made visible and invisible by setting a boolaen property ShowGridLines of ChartAxis class.

For your reference we have created a sample in which the GridLines of the first series alone gets displayed. You can download it from the below given link,

http://websamples.syncfusion.com/samples/WPF/F78662/MultipleAxes_WithOneGridLine.zip

Please let us know if you have any queries.

Regards,
Pavithra.J



AD Administrator Syncfusion Team December 30, 2008 06:36 AM UTC

hi

thanks a lot again,

is there any possible way to add space between two axis ???

like in my case i have

seriesChart.Yaxis.Header == series.name;

so, it gives respective name for every axis,i need space between those names.

Yuvraj



PJ Pavithra J Syncfusion Team December 30, 2008 12:10 PM UTC

Hi Yuvraj,

Thanks for your interest in Syncfusion products.

Instead of adding the series name directly to the Header property of the secondary axis, you could use a Textblock to which the series name can be added. Now by setting the Margin property to the textblock you will get the required space.

For your reference we have created a sample and you could download from the below given link,

http://websamples.syncfusion.com/samples/WPF/MultipleAxesSamplewithMargin/MultipleAxesWithMargin.zip

Please let us know if you have any queries.

Thanks,
Pavithra.J


Loader.
Live Chat Icon For mobile
Up arrow icon