OpenXml - 如何删除scatterChart中各点之间的线

时间:2016-06-23 10:03:41

标签: excel openxml

我使用OpenXml在Excel文件中绘制了scatterChart。这些点是由线连接的。我该如何删除该行?我试过这样做:

ScatterStyle scatterStyle = new ScatterStyle() { Val = ScatterStyleValues.Marker };
                scatterchart.AppendChild<ScatterStyle>(scatterStyle);

但Excel修复文件并将值从ScatterStyleValues.Marker更改回ScatterStyleValues.LineMarker。 请帮我。三江源

1 个答案:

答案 0 :(得分:1)

事实证明,你必须为你的系列添加一个shape属性,并添加一个fill = nofill的轮廓。   enter code here

//ChartShapeProperty of series
ChartShapeProperties SeriesShapeProperty = new DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties();
                        DocumentFormat.OpenXml.Drawing.Outline outline = new DocumentFormat.OpenXml.Drawing.Outline(new DocumentFormat.OpenXml.Drawing.NoFill()) { Width = 28575 };
                        SeriesShapeProperty.Append(outline);
                        scatterChartSeries.Append(SeriesShapeProperty);
相关问题