【问题标题】:Excel - Format many chart series incrementallyExcel - 逐步格式化许多图表系列
【发布时间】:2013-12-10 13:49:23
【问题描述】:

我希望能够以非常相似的格式设置许多图表系列的格式,只改变一个特征(例如,标记线颜色),避免手动操作。

我为此设想的一种方法是:1) 设置组中第一个系列的格式,2) 将格式复制到其余部分,3) 使用数组中的值仅更改选定的特征,例如

问题 Excel - Copy format from one chart series to another 与任务#2有关。只要我没有执行任务 #2 的好方法,是否有其他方法可以实现总体目标?

【问题讨论】:

    标签: excel charts


    【解决方案1】:

    为什么不只遍历您希望更改的所有系列并调用设置当前系列格式的函数。然后,该函数可以只接受您希望更改的一个特征作为参数。例如这样的事情(只是一些伪代码,因此您可以更轻松地想象解决方案):

    foreach series in seriesCollection
       format(series, markerLineColor)
    

    函数格式看起来像这样:

    format(Series series, ColorFormat markerLineColor)
       // set all the common parameters
       series.Format.Line.Forecolor = markerLineColor
    

    【讨论】:

    • 这是我提议的。
    猜你喜欢
    • 2017-07-18
    • 1970-01-01
    • 2016-05-04
    • 2021-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多