Hi,
i run in this problem after call chart.toImage, i have this stack trace:
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:418)
at java.util.ArrayList.get(ArrayList.java:431)
at com.aspose.cells.zke.a(Unknown Source)
at com.aspose.cells.zke.k(Unknown Source)
at com.aspose.cells.zke.d(Unknown Source)
at com.aspose.cells.zke.a(Unknown Source)
at com.aspose.cells.zke.a(Unknown Source)
at com.aspose.cells.zke.a(Unknown Source)
at com.aspose.cells.Chart.a(Unknown Source)
at com.aspose.cells.Chart.toImage(Unknown Source)
at com.tagetik.cpm.ooxml.aspose.cells.TestChart.main(TestChart.java:21)
i have Aspose.cells 17.9.
here it is the piece of code
public class TestChart {
public static void main(String[] args) throws Exception {
Workbook wk = new Workbook(“test_chart.xlsx”);
Worksheet worksheet = wk.getWorksheets().get(“MAJOR CATS”);
InOutStream inOutStream = new InOutStream();
Chart chart = worksheet.getCharts().get(“Chart1N”);
ImageOrPrintOptions opts = new ImageOrPrintOptions();
opts.setImageFormat(ImageFormat.getPng());
opts.setOnePagePerSheet(true);
opts.setOnlyArea(true);
opts.setHorizontalResolution(220);
opts.setVerticalResolution(220);
chart.toImage(inOutStream, opts);
}
}
I attach also the xml file.
Can you help me to find where the problem is?
test_chart.zip (105.7 KB)