Free Support Forum -

Insert Charts as a new Worksheet

Dear all,

I would like to create a chart using Aspose.Excel. First of all I’m writing the content of the chart into an existing worksheet, provided by a document template. In the second step I would like to create the chart as a new worksheet and insert this new sheet after the data sheet. How can I perform this task? Using Interop I used XlChartLocation.xlLocationAsNewSheet to determine the arrangement of the Chart within the document.

Thanks in advance


Hi Erik,

To create a chart worksheet, please try:

Excel excel = new Excel();

Worksheet sheet = excel.Worksheets[0];

int sheetIndex = excel.Worksheets.Add(SheetType.Chart);
sheet = excel.Worksheets[sheetIndex];
int index = sheet.Charts.Add(ChartType.Column, 0, 0, 0, 0);
Chart chart = sheet.Charts[index];
chart.NSeries.Add("Sheet1!A1:A3", true);


Hi Laurence,

Thanks for your reply. Now I’m able to create the chart. But there is still one question left. How can I create the diagram, if for example column “B” contains the values for the X – Axis and column “C” the values for the Y – Axis? If I use


two series are created.


Hi Erik,

Please check .