Export chart?


#1

Hello,

Is it possible to programmatically export a chart as a .gif, .jpg or any other image format? For example, the following code will draw me a chart, is it possible to save the chart off as an image?:

int chartIndex = excel.Worksheets[0].Charts.Add(ChartType.Column3DClustered, 10, 1, 31, 14);

Chart chart = excel.Worksheets[0].Charts[0];

chart.NSeries.Add(string.Format(@"C2:G9}"), true);
chart.NSeries.CategoryData = string.Format(@"A2:B9");

chart.NSeries[0].Name = "=C1";
chart.NSeries[1].Name = "=D1";
chart.NSeries[2].Name = "=E1";
chart.NSeries[3].Name = "=F1";
chart.NSeries[4].Name = "=G1";

// chart.SaveAs("c:\mychart.jpg") - something like this do-able ?


#2

This feature is not supported. We had though about this feature but it's too complex and we don't have enough information.


#3

Hi Laurence,

Thanks for the answer & help; is it possible to save in HTML format then ?


#4

Do you mean save an Excel file in HTML format? Currently the answer is no.

You can try Aspose.Excel.Web. It may serve you need if you want to find a web spreadsheet component.