【发布时间】:2022-09-23 13:49:30
【问题描述】:
标签: java aspose.words
标签: java aspose.words
您可以使用 DocumentBuilder.insertChart 方法使用 Aspose.Words 创建图表。另请参阅 Aspose.Words 文档以了解有关 creating charts 的更多信息。 在您的情况下,您应该使用 ChartType.BAR。
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape chartShape = builder.insertChart(ChartType.BAR, 200, 300);
// Chart is created with default data
// here you can modify the chart data
// .....
doc.save("C:\\Temp\\out.docx");
【讨论】: