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

Add a chart in a worksheet different from the first one

Good morning,

I'm trying to add a chart in a worksheet different from the first one.
Code example:
var sheet = workbook.Worksheets [2];
IChartShape chart = sheet.Charts.Add ();
IChartSeries series = chart.Series.Add (chartType);

The graph, however, is added (after having saved the workbook) in the first sheet. How can I add it in a different sheet from the first one?

3 Replies

PK Prakash Kumar D Syncfusion Team December 6, 2018 04:09 AM

Hi Mini, 
Thank you for contacting Syncfusion support. 
We have tried to reproduce to the issue, but it works properly at our end. We have shared a sample for your reference which can be downloaded from the following link. 
Kindly modify the sample to reproduce the issue and share us along with issue reproducing input files. It will be helpful for us to analyze further on this and provide you the solution at earliest. 
Note: The documents shared will not be disclosed and is only for the purpose to reproduce the issue. We assure you that the document will be deleted from our side once the issue is resolved. 
Prakash Kumar 

MD Mini Dev December 6, 2018 10:07 AM

Thank My problem was that I had reversed the values with labels (x and y asses). So the excel generation was corrupted.
I solved

PK Prakash Kumar D Syncfusion Team December 7, 2018 05:49 AM

Hi Mini, 
Thank you for updating us. 
We are glad that your issue is resolved. Please get back to us if you need further assistance. 
Prakash Kumar 

Live Chat Icon For mobile
Up arrow icon