Apache poi Excel line chart points

前端 未结 2 1287
礼貌的吻别
礼貌的吻别 2020-11-29 13:44

I am creating an Excel file with line chart. I\'ve created chart and filled it with data but I cannot create points on my chart. Does anyone know, is there a way I could gen

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 13:58

    Solution:

    CTPlotArea plotArea = xssfChart.getCTChart().getPlotArea();
    CTMarker ctMarker = CTMarker.Factory.newInstance();
    ctMarker.setSymbol(CTMarkerStyle.Factory.newInstance());
    for (CTLineSer ser : plotArea.getLineChartArray()[0].getSerArray()) {
        ser.setMarker(ctMarker);
    }
    

提交回复
热议问题