I’m trying to create a bubble chart with no valid data points. And when I do validateChartLayout, it throws the following exception.
Exception in thread “main” class com.aspose.slides.exceptions.FormatException: Input string was not in the correct format
com.aspose.slides.internal.pr.wn.jy(Unknown Source)
com.aspose.slides.internal.pr.wn.jy(Unknown Source)
com.aspose.slides.internal.pr.wn.jy(Unknown Source)
com.aspose.slides.internal.pr.wn.jy(Unknown Source)
com.aspose.slides.ms.System.n4.jy(Unknown Source)
com.aspose.slides.bk.jy(Unknown Source)
com.aspose.slides.bk.jy(Unknown Source)
com.aspose.slides.ni0.j3(Unknown Source)
com.aspose.slides.ni0.ur(Unknown Source)
com.aspose.slides.ValueAxisBase.t8(Unknown Source)
com.aspose.slides.xt.jy(Unknown Source)
com.aspose.slides.v3.vz(Unknown Source)
com.aspose.slides.v3.fg(Unknown Source)
com.aspose.slides.zp.t7(Unknown Source)
com.aspose.slides.zp.t7(Unknown Source)
com.aspose.slides.zp.jy(Unknown Source)
com.aspose.slides.v3.vz(Unknown Source)
com.aspose.slides.v3.fg(Unknown Source)
com.aspose.slides.fa.jy(Unknown Source)
com.aspose.slides.v3.vz(Unknown Source)
com.aspose.slides.v3.fg(Unknown Source)
com.aspose.slides.ll.qg(Unknown Source)
com.aspose.slides.Chart.validateChartLayout(Unknown Source)
myProject.tempFile.main(tempFile.java:30)
at com.aspose.slides.internal.pr.wn.jy(Unknown Source)
at com.aspose.slides.internal.pr.wn.jy(Unknown Source)
at com.aspose.slides.internal.pr.wn.jy(Unknown Source)
at com.aspose.slides.internal.pr.wn.jy(Unknown Source)
at com.aspose.slides.ms.System.n4.jy(Unknown Source)
at com.aspose.slides.bk.jy(Unknown Source)
at com.aspose.slides.bk.jy(Unknown Source)
at com.aspose.slides.ni0.j3(Unknown Source)
at com.aspose.slides.ni0.ur(Unknown Source)
at com.aspose.slides.ValueAxisBase.t8(Unknown Source)
at com.aspose.slides.xt.jy(Unknown Source)
at com.aspose.slides.v3.vz(Unknown Source)
at com.aspose.slides.v3.fg(Unknown Source)
at com.aspose.slides.zp.t7(Unknown Source)
at com.aspose.slides.zp.t7(Unknown Source)
at com.aspose.slides.zp.jy(Unknown Source)
at com.aspose.slides.v3.vz(Unknown Source)
at com.aspose.slides.v3.fg(Unknown Source)
at com.aspose.slides.fa.jy(Unknown Source)
at com.aspose.slides.v3.vz(Unknown Source)
at com.aspose.slides.v3.fg(Unknown Source)
at com.aspose.slides.ll.qg(Unknown Source)
at com.aspose.slides.Chart.validateChartLayout(Unknown Source)
at myProject.tempFile.main(tempFile.java:30)
Sample code to reproduce the issue.
Presentation pres = new Presentation();
ISlide slide = pres.getSlides().get_Item(0);
IChart chart = slide.getShapes().addChart(com.aspose.slides.ChartType.Bubble, 0, 0, 400, 400);
int defaultWorksheetIndex = 0;
IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();
chart.getChartData().getSeries().clear();
chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType());
IChartSeries series = chart.getChartData().getSeries().get_Item(0);
series.getDataPoints().addDataPointForBubbleSeries( fact.getCell(defaultWorksheetIndex, 2, 2, null),fact.getCell(defaultWorksheetIndex, 2, 3, null),fact.getCell(defaultWorksheetIndex, 2, 4, 11));
chart.setDisplayBlanksAs(DisplayBlanksAsType.Gap);
chart.validateChartLayout();
I’m not sure why I’m getting the exception. Please suggest.
Thanks in advance