Convert Chart to Images using Aspose.Cells

Aspose.Cells - Convert Chart to Images

Charts are visually appealing and make it easy for users to see comparisons, patterns, and trends in data. The Chart class toImage method converts the chart to an image file, that can be saved to disk or stream.

Java

 //Get the Chart image

ImageOrPrintOptions imgOpts = new ImageOrPrintOptions();

imgOpts.setImageFormat(ImageFormat.getPng());

//Save the chart image file.

chart.toImage(new FileOutputStream(dataDir + "AsposeChartImage.png"), imgOpts);

Download Running Code

Download Sample Code