We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Accessing existing charts

Im using ASP.net version 3.5 wit C# and using Aspose.cells. Im trying to access an existing chart in an existing workbook. I can open the workbook and access cells and update there values, but im having trouble locating the charts within my spreadsheet and updating there Chart data ranges.

Any help would be much appreciated!!


This message was posted using Page2Forum from Setting Charts Data - Aspose.Cells for .NET


Please see the document on how you may manipulate existing charts in the template file.

If you still could not evaluate, kindly do post your template file with sample code here, we will check it soon.

Thank you.

tried working from that document, but no luck, hopefully ive not overlooked something obvious, here is my source code, ive attached my template file if it helps.
Workbook wb = new Workbook();
Aspose.Cells.Charts.Chart chart = wb.Worksheets[0].Charts[0];

chart.NSeries.Add("A1:G3", true);


Compilation Error on line 3 - Error - "The type name 'Chart' does not exist in the type 'Aspose.cells.Charts'

Also if I run "wb.Worksheets[0].Charts.Count" after I open the workbook it returns 0 even though there is charts in my spreadsheet.

Thank You


You might be using some older version before v5.0.0. The Chart APIs are in Aspose.Cells.Charts namespace, so you need to import that namespace into your program. I have attached latest version/fix v5.1.3.1. I have tested the following code, it works fine with it.

Workbook wb = new Workbook(@“e:\test\help.xls”);
MessageBox.Show(wb.Worksheets[0].Charts.Count.ToString()); //1 - OK
Aspose.Cells.Charts.Chart chart = wb.Worksheets[0].Charts[0];

chart.NSeries.Add(“A1:G3”, true);


To know about complete hierarchy of Aspose.Cells namespaces, see the documents:

Thank you.


Thanks for that using the new version works ok, however I don’t have a license to use version and am still interested in changing the data range as I change the size of the data tables, is this possible or will I have to upgrade the license.

Kind Regards


Well, I am afraid, you need to upgrade your subscription to use new versions/fixes of the product. The latest version has a lot of new features and enhancements for existing features.

Moreover, if you got some issues, we are bound to fix the issues and provide you the fix in quick time. This is possible if you have a valid license.

Thank you.