我们公司使用的是 aspose-slides-16.4.0.jar 企业版。
比如,给 Clustered Column赋值是使用 series.getDataPoints().addDataPointForBarSeries。
那么,High Low Close 如何赋值?
我们公司使用的是 aspose-slides-16.4.0.jar 企业版。
比如,给 Clustered Column赋值是使用 series.getDataPoints().addDataPointForBarSeries。
那么,High Low Close 如何赋值?
import com.aspose.slides.ChartType;
import com.aspose.slides.IChart;
import com.aspose.slides.IChartDataCell;
import com.aspose.slides.IChartDataPointCollection;
import com.aspose.slides.IChartDataWorkbook;
import com.aspose.slides.IChartSeries;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;
public class TestHighLowClose {
public void testHighLowClose() {
Presentation presentation = new Presentation();
IChart chart = presentation.getSlides().get_Item(0).getShapes().addChart(ChartType.HighLowClose, 100, 100, 400, 400);
chart.getChartData().getSeries().clear();
chart.getChartData().getCategories().clear();
IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();
fact.clear(0);
fact.clear(1);
fact.clear(2);
fact.clear(3);
fact.clear(4);
{
int defaultWorksheetIndex = 0;
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "First Qtr"));
IChartSeries series = chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType());
IChartDataPointCollection icdpc = series.getDataPoints();
IChartDataCell cell = fact.getCell(defaultWorksheetIndex, 1, 1, 20);
// Problem : addDataPointForBarSeries is not applicable to ChartType.HighLowClose
icdpc.addDataPointForBarSeries(cell); // Exception : Parent series is not Bar series.
}
presentation.save("C:\\Users\\Administrator\\Desktop\\HighLowClose.pptx", SaveFormat.Pptx);
}
public static void main(String[] args) {
new TestHighLowClose().testHighLowClose();
}
}
我已经观察了您共享的示例代码,并且想要分享ID已经在iur iasue跟踪系统中添加了ID SLIDESJAVA-36564的问题,以便调查并解决此问题。此主题已与该问题相关联,因此一旦问题得到解决,您可能会收到通知。