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

Free Support Forum - aspose.com

Image of charts

Is there a way to create an image of a chart? I saw you had plans to do this. If it is not done, when do you plan on having this complete. Thanks.

Matt

Hi Matt,

We are doing some final works for this new feature. A new version including this feature will be released in 3-5 days.

Awesome. Thanks a lot.

Matt

Laurence:

Hi Matt,

We are doing some final works for this new feature. A new version including this feature will be released in 3-5 days.

Is this functionality available now?

Todd

Hi Todd,

Well, we are in the process of extensive testation of the newer version before its official release. Hopefully it will be done soon. In the mean time you may try the latest bugfix (4.1.2.13) downloading @: <A href="</A> <FONT color=#000000>and use the following line of code after creating the chart E.g.,: </FONT></P> <P><FONT color=#000000>System.Drawing.Bitmap img = chart.ToImage();</FONT></P> <P><FONT color=#000000>img.Save("d:\\test\\chartimage.bmp");

Thank you.

Awesome! Thanks.

Saving to an image looks like it's still in pretty rough shape. Do you have an estimate on when this will be production ready?

Thanks,

Todd

Please try this attached version. It supports this feature. A public version will be release in a few days.

Aspose.Cells supported to convert the Excel Charts to images and PDF formats some years ago. The feature has now become more robust and efficient. In order to provide rendering support, the Chart class has exposed ToImage & ToPdf methods with a verity of overloads to best suit your application requirements.

See the following sample code for your reference:
e.g
Sample code:

// Instantiating a Workbook object
Workbook workbook = new Workbook(filePath);
//Get the first worksheet.
Worksheet worksheet = workbook.Worksheets[0];

// Accessing the first instance of the existing chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[0];
// Create an instance of ImageOrPrintOptions and set a few properties
ImageOrPrintOptions options = new ImageOrPrintOptions()
{
    VerticalResolution = 300,
    HorizontalResolution = 300,
    SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
};
// Convert chart to image with additional settings
chart.ToImage("chartPNG_out.png", options);

See the document for your further reference:
Chart Rendering

You may also download the up-to-date examples/demos here.