Access chart in design file



I'm evaluating Aspose.cell for my client. The needs are:

use a xls file as a template, and fill it with data from database. Some stuff seem to work exept one.

In the template we have chart (named) so the question :

How access this chart with their name ?

It's seem all the chart are in the collection DesignerCharts but all are empty. How use it ? I need to update the chart data source.

Thanks you for the answer.




Thanks for considering Aspose.

Do you have a custom user defined chart in your template file?

Well you may access a chart by its index number. following is the sample code:

int index=0;

Chart chart = worksheet.DesignCharts[index];


Amjad Sahi

Aspose Nanjing Team


Hi David,

Could you please post your xls file here? Thank you.


This is a sample xls template with 3 charts


This is the watch i have in Visual studio when i parse the first chart.



Hi David,

To changed the data source, you can try:

Workbook wb = new Workbook();


wb.Worksheets[0].DesignCharts[0].NSeries.Add("A1:A5", true);


Currently there are limitations to access chart design file. We are working to convert chart data in designer file to Aspose.Cells chart object model to allow you access them same as charts created at run time. It will take several month to make it.


I have a dozen or so web pages that contain charts. I found the simplest was to update the charts was to have a hidden worksheet with chart's datasource set to a range on that hidden worksheet. Then all I have to do when I save the report is update the range with the appropriate data and the chart is automatically updated.

One of my reports has up to 10 tabs with a separate report on each tab and 5 charts on each report. The hidden worksheet method works flawlessly.