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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Mixed Series Types on the Secondary Axis XLSIO

Thread ID:





91574 Nov 24,2009 11:57 AM UTC Dec 2,2009 09:38 AM UTC WinForms 12
Tags: XlsIO
Jason Cohen
Asked On November 24, 2009 11:57 AM UTC

I have a chart that I would like to export to Excel using Syncfusion.

It has a single Line Series on the Primary Axis and two series on the Secondary Axis, one of which is of Series Type Line Series the other ColumnStacked.

Attempting to configure the chart object using Syncfusion I consistently get the following error is there a solution for this?:

System.ArgumentException occurred
Message="Item has already been added. Key in dictionary: 'Line' Key being added: 'Line'"
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at Syncfusion.XlsIO.Implementation.Charts.ChartSeriesCollection.FindOrderByType(ExcelChartType type)
at Syncfusion.XlsIO.Implementation.Charts.ChartSerieImpl.ChangeCombinationType(ExcelChartType type)
at Syncfusion.XlsIO.Implementation.Charts.ChartSerieImpl.OnSerieTypeChange(ExcelChartType type, Boolean isSeriesCreation)
at Syncfusion.XlsIO.Implementation.Charts.ChartSerieImpl.ChangeSeriesType(ExcelChartType seriesType, Boolean isSeriesCreation)
at Syncfusion.XlsIO.Implementation.Charts.ChartSerieImpl.set_SerieType(ExcelChartType value)
at Paragon.PDV.IO.ExcelFileCreator.AddSeries(SeriesData series) in D:\Local Repositories\Paragon DotNet\Operations\Projects\PDV\trunk\PDV\IO\ExcelFileCreator.cs:line 697

It seems that the Secondary Axis will only support multiple series of the same SeriesType?

Jason Cohen
Replied On November 24, 2009 02:02 PM UTC

I should have mentioned I'm using Syncfusion XLSIO version and viewing the result using Office 2003

Balamurugan R [Syncfusion]
Replied On November 25, 2009 08:28 AM UTC

Hi Jason,

Thank you for using syncfusion product.
I am unable to reproduce the issue. I have attached the sample as per your requirements.
Please.let us know if you have any queries.


Forum Id 91574_876fcbdf.zip

Jason Cohen
Replied On November 25, 2009 09:50 AM UTC


thanks for the sample, I'm preparing a sample project to demonstrate the issue.



Balamurugan R [Syncfusion]
Replied On November 25, 2009 10:10 AM UTC

Hi Jason,

Thank you for using Essential XlsIO.
Please,let us know if you have any queries.


Jason Cohen
Replied On November 25, 2009 10:39 AM UTC

Please find the attached example.

Note I've included the chart as I would have expected it to be created.


Balamurugan R [Syncfusion]
Replied On November 25, 2009 01:09 PM UTC

Hi Jason,

Thank you for using Syncfusion Products.

I have analysied your problem.It is possible based on the chart type.You have to initialized various chart type in primary series.Then you can use it in the secondary series.I have attached the sample for your reference.

Please,let us know if you have any queries.


Forum1 Id 91574_bee22dc0.zip

Jason Cohen
Replied On November 25, 2009 03:37 PM UTC

Hi thanks for your response, however the source code you have provided throws the following exception when setting the secondarySeries2 to use the Secondary Axis:

System.ApplicationException was unhandled
Message="Can't set current serie to secondary axis"
at Syncfusion.XlsIO.Implementation.Charts.ChartSerieImpl.ChangeAxis(Boolean bToPrimary)
at Syncfusion.XlsIO.Implementation.Charts.ChartSerieImpl.set_UsePrimaryAxis(Boolean value)
at ConsoleApplication2.Program.Main(String[] args) in C:\Documents and Settings\jason.cohen\My Documents\Downloads\Forum1 Id 91574_bee22dc0\Forum1 Id 91574\ConsoleApplication2\Program.cs:line 93
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Balamurugan R [Syncfusion]
Replied On November 26, 2009 11:28 AM UTC

Hi Jason,

I have understand your problem.let us use two primary series and one secondary series to over ride your problem.


Forum2 Id 91574_d14a7a3b.zip

Jason Cohen
Replied On November 27, 2009 03:21 PM UTC

Hi Balamurugan

thanks for your code, although in your latest example there is only one secondary axis series?

We have a case where there is mixed series types on both the primary and mixed series types on the Secondary, where the series on the primary ranges differ greatly to those on the secondary.

It is possible to configure the chart in question directly within Excel.

Thanks for your help so far.

Balamurugan R [Syncfusion]
Replied On December 1, 2009 03:56 AM UTC

Hi Jason,
Thank you for your interest.
It is possible to draw a chart directly with excel.


Jason Cohen
Replied On December 1, 2009 09:57 AM UTC

Hi Balamurugan,

I think you misread my previous post, to paraphrase:-

We need to create a chart with series on both the Primary & Secondary Axis where there is more that one series type on the secondary Axis.

Syncfusion XLSIO version throws exceptions when you try to do this.

The aforementioned chart can be created directly within Excel so why is there an issue trying to do it through Syncfusion?



Balamurugan R [Syncfusion]
Replied On December 2, 2009 09:38 AM UTC

Hi Jason,

Thank you for interest in syncfusion products.
I was able to analysis your problem.We cannot provide more details through the public forum so please open an direct trac incident so that we can provide the necessary informations.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon