Connector lines show between the categories. I don’t think they should be there (they are not visible in Percent Column chart type). See attached file for example. Code:
public static void main(String[] args) {
PresentationEx pres = new PresentationEx();
SlideEx slide = pres.getSlides().get_Item(0);
ChartEx c = slide.getShapes().addChart(
ChartTypeEx.PercentsStackedBar, 0, 0, 500, 500);
ChartDataEx cd = c.getChartData();
cd.getSeries().clear();
cd.getCategories().clear();
ChartDataCellFactory data =
cd.getChartDataCellFactory();
data.clear(0);
List cs = new ArrayList();
cs.add(Color.GREEN);
cs.add(Color.RED);
cs.add(Color.BLUE);
cs.add(Color.DARK_GRAY);
int rowCount = 5;
int colCount = 2;
Random gen = new Random();
for(int i = 0; i < rowCount; i++) {
cd.getSeries().add(data.getCell(
0, i+1, 0, "Series "+i), c.getType());
}
for(int i = 0; i < colCount; i++) {
cd.getCategories().add(data.getCell(
0, 0, i+1, “Category “+i));
}
for(int r = 0; r < rowCount; r++) {
ChartSeriesEx series = cd.getSeries().get_Item®;
for(int i = 0; i < colCount; i++) {
series.getValues().add(data.getCell(0, r+1, i+1, gen.nextInt(10)+1));
}
FillFormatEx f = series.getFormat().getFill();
f.setFillType(FillTypeEx.Solid);
f.getSolidFillColor().setColor(cs.get(r%cs.size()));
LineFormatEx l = series.getFormat().getLine();
l.getFillFormat().setFillType(FillTypeEx.Solid);
}
pres.write(”!!export.pptx”);
System.out.println(“Done”);
}