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
close icon

How to reorder series on a chart

Hi,

I am opening an Excel template with a scatter chart already defined on it. This chart has a couple of series predefined (background points, median lines) which only requires the data to be added to the referenced cells.

But I have to add a number of series for specific products which can change depending on the type of chart being produced. I can add these series no problem, but I can't figure out how to reorder the new series. Currently they show up behind the pre-defined series and I want to move my new series to the top so they show up above all the background points and median lines. How do I do this?

Thanks,
Mark


5 Replies

SR Sridhar Syncfusion Team September 14, 2011 10:37 AM UTC

Hi Mark,

Thank you very much for using Syncfusion products.

We have tried the sample at our side to add the new series with the already created scatter chart template and we could see the new series points are shown at the top. We are unable to change the sereis order it has been created and shown automatically for the newly created one at the top.

We have attached the sample for your reference. Please try the sample at your side and let us know if these helps you.

In the sample code at line 32 set the serie.Values=sheet.Range["B2:B11"] then the series shown at the top.

Please let us know if you require any further clarifications.

Thanks,
Sridhar.S



DataSeries-84785_e8c7843b.zip


MO Mark Oudesluys September 14, 2011 08:00 PM UTC

Hi,

I tried your sample project and it didn't work. I get the New series still showing up behind the two existing series. It also adds Labels to the series even through they are defined without labels and I turn the labels for the New series off (false). I fact, it turns on all Labels (Series Name, X and Y Values) for all series.

As a note, I have some patches provided by your company applied to my project. I am going to add this as part of my open incident as I believe this is a defect in your product.

Thanks,
Mark



SR Sridhar Syncfusion Team September 15, 2011 06:28 AM UTC

Hi Mark,

Thank you so much for the update and the sample.

Please follow up on the incident 84907 for further updates of the above reported query.

Thanks,
Sridhar.S



MO Mark Oudesluys September 20, 2011 07:52 PM UTC

Hi,

I did some research into this issue (moving data points infront of existing data points) and here is what you have to do.

The existing series are on the Primary Axis. When adding a new series, add it to the Secondary Axis:

IChart chart = wsPage.Charts[0];
IChartSerie bseries = chart.Series.Add("New Series", ExcelChartType.Scatter_Markers);
bseries.UsePrimaryAxis = false;

Then at the end of processing the chart, make the secondary axis invisible:

if (chart.SecondaryValueAxis.Visible) chart.SecondaryValueAxis.Visible = false;

By adding the new series to the Secondary Axis it gets placed in front of the Primary Axis points. Then hiding the Secondary Axis at the end places all Series on the Primary Axis but keeps the current positioning.

This is how you have to do this in the new Excel 2007/2010. Too bad, as it is quite a deviation from the previous versions of Excel.

Thanks,
Mark



SR Sridhar Syncfusion Team September 21, 2011 11:35 AM UTC

Hi Mark,

Thank you very much for the feedback and the valuable information.

Thanks for your support and assitance.

Regards,
Sridhar.S


Loader.
Live Chat Icon For mobile
Up arrow icon