excel - How to get a scatter Chart Series MarkerBackgroundColor if marker filling is set to Automatic?
问题描述
I have a scatter chart with multiple series and a trendline per series. I want to set the trendline datalable to be the same color as the series' fill color. The series' fill color is Automatic. The .MarkerBackgroundColor
property returns -1 for all series while the .MarkerBackgroundColorIndex
returns 2 for all series. I believe this only happens if the marker fill is set to Automatic. However, I can't change that because the series in the chart get added through another VBA code based on dynamic data. Any help?
For i = 1 To Sheet1.ChartObjects("Chart 5").Chart.SeriesCollection.Count
With Sheet1.ChartObjects("Chart 5").Chart.FullSeriesCollection(i)
.Trendlines(1).DataLabel.Format.Fill.ForeColor.RGB = .MarkerBackgroundColor
End With
Next i
解决方案
推荐阅读
- mysql - 如果不满足条件,我如何在选定范围内包含上一行
- javascript - Vue搜索过滤器复选框问题
- javascript - 将数据 (d3) 投影到传单地图上的问题
- javascript - 如何获得类型化反应组件属性的代码完成?
- linux - apache linux中的ldap身份验证
- powerbi - 使用 Spark odbc 连接器从 Azure 数据工厂连接到 Databricks 表时出现问题
- amazon-web-services - AWS 上的串行 COM 端口
- excel - SumIF 使用表/命名范围而不是单个单元格条件
- vba - Outlook.Mailitem 未能被另一个子调用
- android - 当我使用带有位图或可绘制位图的滑动时,应用程序在添加第 4 个连续图像时不断崩溃