当 最小值、最大值、主要刻度单位、次要刻度单位是【自动】时,如何获取Y轴的最大值quzhi.jpg (50.8 KB)
@mudassir.fayyaz,
IChart chart;
chart.getAxes().getVerticalAxis().setAutomaticMaxValue(true);
从PPT来看 chart.getAxes().getVerticalAxis().getMaxValue() 应该等于350.0
但是在程序中取出来是0.0
我应该怎么获取 chart.getAxes().getVerticalAxis().getMaxValue()
quzhi.jpg (50.8 KB)
在下面的示例代码中,我想在Y坐标轴最大值是自动设置时,获取Y轴最大值
public static void testAutoMaxY() {
Presentation presentation = new Presentation();
IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 400, 400);
// Initialization
{
int defaultWorksheetIndex = 0;
IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();
chart.getChartData().getSeries().clear();
chart.getChartData().getCategories().clear();
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "First Qtr"));
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Sec Qtr"));
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Thd Qtr"));
IChartSeries series = chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType());
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30));
}
// Problem
{
chart.getAxes().getVerticalAxis().setAutomaticMaxValue(true);
System.out.println("Automatic Max Value is [" + chart.getAxes().getVerticalAxis().getMaxValue() + "]");
}
presentation.save("C:\\Users\\Administrator\\Desktop\\Column.pptx", SaveFormat.Pptx);
}
自动-最大值.jpg (49.1 KB)
The issues you have found earlier (filed as SLIDESJAVA-37018) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz