Initial stacked chart view incorrect if series values are blank

This issue affects stacked charts. If all the values for a series are blank the initial chart view is wrong. In this example the bars should be reaching 100%.


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

The view is corrected if you enter the data and then exit again without making changes.

Output attached.

Hi Shaun,


I have worked with the sample code shared by you and as per your point if the chart is of stacked bar percent type and when removing one series data items completely, the chart must adjust remaining two series data to 100%. However, it is not getting readjusted to 100% in Aspose.Slides generated presentation. An issue with ID SLIDESJAVA-34974 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.

We are sorry for your inconvenience,

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


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