示例1生成的图多了个系列。示例2生成的文档使用office打不开

我使用的是aspose-words-21.1.0-jdk17.jar,示例1生成的图多了个系列。示例2生成的文档使用office打不开,AsposeZHT 里面有示例1和示例2方法:
文叔叔 - 传文件,找文叔叔(永不限速) 复制链接到浏览器打开
8836c4a8059cc194eda2cca4a91314e.png (4.1 KB)
请问该怎么解决

@SalesDhorde, 示例 1 代码中的问题在 Aspose.Words 21.1 中可以重现,但已在 Aspose.Words 23.4 中修复。 请切换到此版本或更高版本:

doc = new Document("DZZHT.docx");
builder = new DocumentBuilder(doc);

double[] lstV1 = new double[]{71.0, 65.0, 200.0, 300.0, 200.0};
double[] lstV2 = new double[]{14.0, 0.0, 74.0, 0.0, 68.0};

Shape shape = getChart("单轴组合图");
Chart chart = shape.getChart();

chart.getSeries().clear();

String[] categories1 = new String[]{"王小石", "南晓强", "吴贵福","李毅","庞雅玲"};
chart.getSeries().add("BNMB", categories1, lstV1);
chart.getSeries().add("LJWC", categories1, lstV2);

doc.save("example1.docx");

example1.aw.21.1.docx (19.9 KB)
example1.aw.23.4.docx (13.1 KB)

这同样适用于示例 2 代码。 它在 23.4 或更高版本上运行良好:

doc = new Document("DZZHT.docx");
DocumentBuilder builder = new DocumentBuilder(doc);

double[] lstV1 = new double[]{71.0, 65.0, 200.0,300.0,200.0};
double[] lstV2 = new double[]{14.0, 0.0, 74.0,0.0,68.0};
double[] lstV3 = new double[]{1.0, 2.0, 7.0,0.0,8.0};
Shape shape = getChart("单轴组合图");
Chart chart = shape.getChart();
chart.getSeries().clear();
String[] categories1 = new String[]{"王小石", "南晓强", "吴贵福","李毅","庞雅玲"};
chart.getSeries().add("BNMB", categories1, lstV1);
chart.getSeries().add("LJWC", categories1, lstV2);
chart.getSeries().add("GL", categories1, lstV3);

doc.save("example2.docx");

example2.21.1.docx (20.0 KB)
example2.23.4.docx (13.1 KB)

已经下载最新版本测试,但是我设置的组合图,还是没法生效
微信图片_20231225103222.png (19.0 KB)

生成的图依然是三个柱状图

@SalesDhorde, 您可以附上用于创建屏幕截图的文档吗?

我尝试在 Microsoft Word 中打开 example1.aw.23.4.docx 和 example2.23.4.docx 的相同对话框,但我只能看到 2 个直方图:

我需要设置成文档里面的图表,也就是系列3改成折线图,怎么实现呢?我上面截图有选择成折线图,但是没有正确显示,还是柱状图。生成的代码,第一次提交问题的时候在压缩包里看示例2。
DZZHT.docx (25.6 KB)

4730eb5b60d4db7efbafc6533bc53cb.png (36.5 KB)

@SalesDhorde, 我无法重现您的问题。 我使用上面发布的代码创建了 example1.aw.23.4.docx 和 example2.23.4.docx。 您的 AsposeWordsChart\src\main\resources\DZZHT.docx 被用作输入文档。

请尝试创建使用最新 Aspose.Words 的尽可能最小的控制台应用程序,并将其附加在此处以演示该问题。

文叔叔 - 传文件,找文叔叔(永不限速) 复制链接到浏览器打开

输入文档是AsposeWordsChart\src\main\resources\DZZHT.docx
输出文档是:单轴组合图报告
单轴组合图报告.docx (13.4 KB)

如何才能让我的文档里图表展现的三个柱状图变成两个柱状图一个折线图

@SalesDhorde, 感谢您报告此问题。 我们已经在我们的内部问题跟踪系统中打开了以下新工单,并将根据 免费支持政策 中提到的条款提供它们的修复:

Issue ID(s): WORDSNET-26410

如果您需要优先支持以及直接联系我们的付费支持管理团队,您可以获得 付费支持服务

@SalesDhorde 请查看以下代码,以满足您的要求

Document doc = new Document("in.docx");

double[] lstV1 = new double[] { 71.0, 65.0, 200.0, 300.0, 200.0 };
double[] lstV2 = new double[] { 14.0, 0.0, 74.0, 0.0, 68.0 };
double[] lstV3 = new double[] { 1.0, 2.0, 7.0, 0.0, 8.0 };
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Chart chart = shape.getChart();

for (ChartSeries series : chart.getSeries())
    series.clearValues();

String[] categories1 = new String[] { "王小石", "南晓强", "吴贵福", "李毅", "庞雅玲" };

ChartSeries series1 = chart.getSeries().get(0);
ChartSeries series2 = chart.getSeries().get(1);
ChartSeries series3 = chart.getSeries().get(2);

series1.setName("BNMB");
series2.setName("LJWC");
series3.setName("GL");

for (int i = 0; i < categories1.length; i++)
{
    ChartXValue x = ChartXValue.fromString(categories1[i]);
    series1.add(x, ChartYValue.fromDouble(lstV1[i]));
    series2.add(x, ChartYValue.fromDouble(lstV2[i]));
    series3.add(x, ChartYValue.fromDouble(lstV3[i]));
}

doc.save("out.docx");