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.
Unfortunately, activation email could not send to your email. Please try again.

How to reorder series on a chart

Thread ID:

Created:

Updated:

Platform:

Replies:

100912 Sep 13,2011 04:17 PM Sep 21,2011 07:35 AM ASP.NET Web Forms (Classic) 5
loading
Tags: XlsIO
Mark Oudesluys
Asked On September 13, 2011 04:17 PM

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


Sridhar [Syncfusion]
Replied On September 14, 2011 06:37 AM

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

Mark Oudesluys
Replied On September 14, 2011 04:00 PM

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


Sridhar [Syncfusion]
Replied On September 15, 2011 02:28 AM

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


Mark Oudesluys
Replied On September 20, 2011 03:52 PM

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


Sridhar [Syncfusion]
Replied On September 21, 2011 07:35 AM

Hi Mark,

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

Thanks for your support and assitance.

Regards,
Sridhar.S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;