Getting Theme Color info from Chart Series

前端 未结 2 1472
孤城傲影
孤城傲影 2021-01-18 20:12

I have a chart series using one color (it can be an msoThemeColorAccent<#> or any other) for the marker line, another color for the marker fill (it can be

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 20:17

    It is one of solutions DeerSpotter. But after you change your chart type to some temp ChartType and then changing it back to original one. You are losing some format. For an example, you get second axis after it, what is not always need.

    So, when your chart line color set automatically, you can not simply get color index of it. You would always receive 0 or 16777215 - white color. The best solution is to just before you try to change or get your chart line color, to do this little trick with Line.Visible tur off and then trun on. After it you can simply read and chnage your line color.

    ppSeries.Format.Line.Visible = msoFalse 
    ppSeries.Format.Line.Visible = msoTrue
    

提交回复
热议问题