Skip to content
本页内容

MarkerBackgroundColor (属性)

将数据标志的背景色设置为 RGB 值或返回对应的颜色索引值。仅适用于折线图、散点图和雷达图。int 型,可读写。

示例

python
#此示例为 Chart1 中第一个数据系列的第二个数据点的标记设置背景色和前景色
def test():
    point = Application.Charts.Item("Chart1").ChartObjects(1).Chart.SeriesCollection(1).Points(2)
    point.MarkerBackgroundColor = RGB(0, 255, 0)  #green fill
    point.MarkerForegroundColor = RGB(255, 0, 0)  #red border
python
#此示例将 Chart1 中第一个数据系列的奇数位的数据点的背景色设置为金色
def test():
    points = Application.Charts.Item("Chart1").ChartObjects(1).Chart.SeriesCollection(1).Points()
    for i in range(1, points.Count, 2):
        points.Item(i).MarkerBackgroundColor = RGB(255, 215, 0)