主题
ShowLegendKey (属性)
如果数据标签图例项标示可见,则为 True。bool 类型,可读写。
示例
python
#此示例设置 Chart1 中系列一的数据标签,以显示数值和图例标示
def test():
datalabels = Application.Charts.Item("Chart1").ChartObjects(1).Chart.SeriesCollection(1).DataLabels()
datalabels.ShowLegendKey = True
datalabels.ShowValue = True
python
#此示例显示工作表 Sheet1 中第一张图表的第三个系列的数据标签的图例标示是否可见
def test():
datalabels = Application.Sheets.Item("Sheet1").ChartObjects(1).Chart.SeriesCollection(3).DataLabels()
print(datalabels.ShowLegendKey)