Excel VBA - How do you set line style for chart series?

后端 未结 3 1480
半阙折子戏
半阙折子戏 2021-01-21 04:17

I would like the plot lines in a chart to be either solid, circle dot, or square dot based upon a certain criteria specified by the user. I can successfully set the line color

3条回答
  •  渐次进展
    2021-01-21 04:36

    YourChartSeries.Border.LineStyle = [some value from the XlLineStyle enumeration]
    

    UPDATE: recording in XL 2010 I get this -

    ActiveChart.SeriesCollection(1).Select
    With Selection.Format.Line
        .Visible = msoTrue
        .DashStyle = msoLineSysDot
    End With
    ActiveChart.SeriesCollection(2).Select
    With Selection.Format.Line
        .Visible = msoTrue
        .DashStyle = msoLineSysDash
    End With
    

    Which might be what you're looking for.

提交回复
热议问题