[]
        
(Showing Draft Content)

绘图区域

绘图区域是指在图表后面,下面或旁边的区域或平面。

使用GcExcel Java,您可以使用 IWall 接口和IChart 接口的方法,通过定义后壁和 侧壁的厚度、填充颜色、线条颜色和格式,根据您的自定义首选项配置图表。

为了配置插入工作表中的图表的绘图区域,请参考以下示例代码。

// Config back wall and side wall's format together.
IShape shape1 = worksheet.getShapes().addChart(ChartType.Column3D, 250, 20, 350, 250);
shape1.getChart().getSeriesCollection().add(worksheet.getRange("A1:D6"), RowCol.Columns, true, true);
shape1.getChart().getSideWall().setThickness(5);
shape1.getChart().getSideWall().getFormat().getFill().getColor().setRGB(Color.GetLightGreen());
shape1.getChart().getSideWall().getFormat().getLine().getColor().setRGB(Color.GetLightBlue());
        
// Config back wall's format individually.
IShape shape2 = worksheet.getShapes().addChart(ChartType.Column3D, 250, 20, 350, 250);
shape2.getChart().getSeriesCollection().add(worksheet.getRange("A1:D6"), RowCol.Columns, true, true);
shape2.getChart().getBackWall().setThickness(5);
shape2.getChart().getBackWall().getFormat().getFill().getColor().setRGB(Color.GetLightGreen());
shape2.getChart().getBackWall().getFormat().getLine().getColor().setRGB(Color.GetLightBlue());