We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Last category missing if data points are blank

I have an issue where the last category is not shown initially if the values are blank. In the following example I have taken the default chart and cleared the data value for the last category in each series. The category is still present and should be shown in the chart:


public static void main(String[] args) throws Exception {
final Presentation pres = new Presentation();
final IChart c = pres.getSlides()
.get_Item(0)
.getShapes()
.addChart(
ChartType.ClusteredColumn,
0, 0, 720, 540);
final IChartData data = c.getChartData();
final IChartDataWorkbook wb = data.getChartDataWorkbook();
for(int s = 0; s < data.getSeries().size(); s++) {
final IChartSeries series =
data.getSeries().get_Item(s);
final int lastCategoryIndex =
series.getDataPoints().size()-1;
wb.getCell(0, lastCategoryIndex+1, s+1).setValue(null);
}
pres.save(“D:/test.pptx”, SaveFormat.Pptx);
Desktop.getDesktop().open(new File(“D:/test.pptx”));
}

It does update correctly if you manually enter the data and then exit Excel. However, the initial display is wrong.

Output attached.

Hi Shaun,


I have observed the presentation file shared by you and have worked with the sample code shared as well. I have been able to reproduce the issue on my end it seems to be an issue with Aspose.Slides. An issue with ID SLIDESJAVA-34975 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

As a workaround, please simply use option edit chart data to load chart workbook and close that. The chart will be viewed as per expectations.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-34975) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.