Skip to content
本页内容

Name (属性)

返回对象名称。只读。

说明

此属性对应于图表中数据点的名称。名称用下面的格式表示:S<系列序号>P<数据标记序号>。

返回值

str

示例

python
#此示例显示 Chart1 中第二个数据系列的第三个数据点的名称
def test():
    point = Application.Charts.Item("Chart1").ChartObjects(1).Chart.SeriesCollection(2).Points(3)
    print(f"数据点的名称是 {point.Name}")
python
#此示例将 Chart1 中所有系列的数据点中名称为 "S3P3" 的背景色设置为红色
def test():
    seriesColltion = Application.Charts.Item("Chart1").ChartObjects(1).Chart.SeriesCollection()
    for i in range(1, seriesColltion.Count):
        for n in range(1, seriesColltion.Item(i).Points().Count):
            if seriesColltion.Item(i).Points(n).Name == "S3P3":
                seriesColltion.Item(i).Points(n).MarkerBackgroundColor = RGB(255, 0, 0)