Skip to content
本页内容

HasDataLabel (属性)

如果数据点具有数据标签,则该属性值为 Truebool 类型,可读写。

示例

python
#此示例打开 Chart1 上第三个数据系列的第七个数据点的数据标签,并将该数据标签的颜色设置为蓝色
def test():
    point = Application.Charts.Item("Chart1").ChartObjects(1).Chart.SeriesCollection(3).Points(7)
    point.HasDataLabel = True
    point.ApplyDataLabels(xlValue)
    point.DataLabel.Font.ColorIndex = 5
python
#此示例显示活动工作表第一个图表上第二个数据点是否打开数据标签
def test():
    Application.ActiveSheet.ChartObjects(1).Activate()
    print(ActiveChart.SeriesCollection(1).Points(2).HasDataLabel)