Ms office Office Open XML:在图表中绘制虚线

Ms office Office Open XML:在图表中绘制虚线,ms-office,openxml,openxml-sdk,Ms Office,Openxml,Openxml Sdk,使用office open XML SDK,我绘制了一个带有平滑线条的散点图,但不知道如何更改系列的线条样式以显示虚线?最后,我使用OPenXML生产力工具解决了这个问题。您必须将PresetDash属性更改为System.Dash private void MakeSeriesDashedLine(ScatterChartSeries scs) { C.ChartShapeProperties chartShapeProperties1

使用office open XML SDK,我绘制了一个带有平滑线条的散点图,但不知道如何更改系列的线条样式以显示虚线?

最后,我使用OPenXML生产力工具解决了这个问题。您必须将PresetDash属性更改为System.Dash

private void MakeSeriesDashedLine(ScatterChartSeries scs)
            {
                C.ChartShapeProperties chartShapeProperties1 = new C.ChartShapeProperties();
                A.Outline outline1 = new A.Outline();
                A.PresetDash presetDash1 = new A.PresetDash() { Val = A.PresetLineDashValues.SystemDash };

                outline1.Append(presetDash1);
                chartShapeProperties1.Append(outline1);
                scs.Append(chartShapeProperties1);
            }