Free Support Forum - aspose.com

In Aspose.Cell how to Get Chart by Range

in Aspose.Cell how to Get Chart by Range

i have Aspose.Cells.Range range

i am trying to find chart object inside a range.

please provide an example

thanks.

Hi,

Well, you may get the chart by its index or name.

E.g.,

1).
.........

int index = worksheet.Charts.Add(ChartType.Column, 3, 3, 10, 8);

Chart chart = worksheet.Charts[index];


2).

Workbook workbook = new Workbook();

workbook.Open("d:\\test\\mychart_1.xls");

//Get the first chart in the first worksheet of the excel file.

Aspose.Cells.Chart chart = workbook.Worksheets[0].Charts[0];
..........

Thank you.

thanks for your reply, but the client doesn't know the index, but if you copy directly from excel from a range, the chart will copied as well...

is there any way i can find the chart index from a range...

thanks for your help