Convert Chart to Image in xlsx4j

Aspose.Cells - Convert Chart to Image

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_Out.png"), imgOpts);

Download Running Code

Download Sample Code