OpenXml - 如何删除散点图中各点之间的线
OpenXml - How to remove lines between points in a scatterChart
我使用 OpenXml 在 Excel 文件中绘制了一个散点图。这些点由线连接。我怎样才能删除该行?我试过这样做:
ScatterStyle scatterStyle = new ScatterStyle() { Val = ScatterStyleValues.Marker };
scatterchart.AppendChild<ScatterStyle>(scatterStyle);
但是 Excel 修复了文件并将值从 ScatterStyleValues.Marker 更改回 ScatterStyleValues.LineMarker。
请帮我。谢谢
事实证明,您必须向您的系列添加一个形状 属性,并添加一个轮廓,其中 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);
我使用 OpenXml 在 Excel 文件中绘制了一个散点图。这些点由线连接。我怎样才能删除该行?我试过这样做:
ScatterStyle scatterStyle = new ScatterStyle() { Val = ScatterStyleValues.Marker };
scatterchart.AppendChild<ScatterStyle>(scatterStyle);
但是 Excel 修复了文件并将值从 ScatterStyleValues.Marker 更改回 ScatterStyleValues.LineMarker。 请帮我。谢谢
事实证明,您必须向您的系列添加一个形状 属性,并添加一个轮廓,其中 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);