If you have a chart that specifies (for example) $B$1:$B$3 as the data range, you can insert a row above B3 and the chart will update itself.
When I use the InsertRow() method, the Charts in Excel are not updated to reflect the changes. Is this a bug or is there something else I need to do?
Thanks, Natan.
Hi Natan,
We just didn’t think of that. Please try this attached dll. It should solve this issue.
@cohenn,
Aspose.Excel is discontinued and no more available now. It is replaced by Aspose.Cells that has support for all the latest features of different versions of MS Excel. You can update sheet similar to the MS Excel like when a data row is inserted into the sheet, the chart is updated as well. Here is the sample code:
Workbook workbook = new Workbook("Book1.xlsx");
workbook.Worksheets[0].Cells.InsertRow(2);
workbook.Worksheets[0].Cells["A3"].Value = 2007;
workbook.Worksheets[0].Cells["B3"].Value = 33;
workbook.Worksheets[0].Charts[0].Calculate();
workbook.Save("Book2.xlsx");
Refer to the following link where charts manipulation is discussed in detail:
Charts
The latest trial version of this product can be downloaded here:
Aspose.Cells for .NET (Latest Version)
Here is a ready-to-run application that can be used to test the features of this product.