Convert Chart to Image in xlsx4j
Contents
[
Hide
]
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
For more details, visit Converting Chart to Image.