Skip to content
本页内容

ColorIndex (属性)

返回或设置一个 Any 值,它代表边框的颜色。

说明

颜色可指定为当前调色板中颜色的索引值,也可指定为下列 XlColorIndex 常量之一:

  • xlColorIndexAutomatic
  • xlColorIndexNone

示例

python
#本示例为 Chart1 中数值坐标轴的主要网格线设置颜色
def test():
    axis = Application.Charts.Item("Chart1").Axes(xlValue)
    if axis.HasMajorGridlines:
        # set color to blue
        axis.MajorGridlines.Border.ColorIndex = 5
python
#本示例显示 Chart1 中数值坐标轴的边框是否为无颜色
def test():
    chart = Application.Charts.Item("Chart1")
    print(chart.Axes(xlValue).Border.ColorIndex == xlColorIndexNone)