如何获取y轴最大值

当 最小值、最大值、主要刻度单位、次要刻度单位是【自动】时,如何获取Y轴的最大值quzhi.jpg (50.8 KB)

@cpych,

我观察到您分享的信息,但无法完全理解这一点。我请求你分享问题的细节,以便我们继续进一步帮助你。

@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)

@cpych,

我请求您请提供您尝试访问这些值的源代码演示文稿。 我会调查介绍我的最终帮助你。

@mudassir.fayyaz

在下面的示例代码中,我想在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)

@cpych,

我观察了你的意见。我在问题跟踪系统中为ID SLIDESJAVA-37018创建了一个问题来调查问题。此主题已与该问题相关联,以便在问题得到解决后自动通知您。

@Adnan.Ahmad
谢谢

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