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

Mixed Series Types on the Secondary Axis XLSIO


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'"
Source="mscorlib"
StackTrace:
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
InnerException:


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

12 Replies

JC Jason Cohen November 24, 2009 02:02 PM UTC

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


BR Balamurugan R Syncfusion Team 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.

Regards,
Balamurugan.



Forum Id 91574_876fcbdf.zip


JC Jason Cohen November 25, 2009 09:50 AM UTC

Hi,

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

Regards,

Jason,


BR Balamurugan R Syncfusion Team November 25, 2009 10:10 AM UTC

Hi Jason,

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

Regards,
Balamurugan.


JC Jason Cohen 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.



SecondarySeriesSample_cce2ce4d.zip


BR Balamurugan R Syncfusion Team 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.

Regards,
Balamurugan.



Forum1 Id 91574_bee22dc0.zip


JC Jason Cohen 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"
Source="Syncfusion.XlsIO.Base"
StackTrace:
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()
InnerException:



BR Balamurugan R Syncfusion Team 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.

Regards,
Balamurugan




Forum2 Id 91574_d14a7a3b.zip


JC Jason Cohen 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.



BR Balamurugan R Syncfusion Team December 1, 2009 03:56 AM UTC

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

Regards,
Balamurugan.


JC Jason Cohen 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 6.3.0.30 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?

Regards,

Jason.


BR Balamurugan R Syncfusion Team 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.

Regards,
Balamurugan.

Loader.
Live Chat Icon For mobile
Up arrow icon