ExcelScript.ChartSeries interface

代表图表上的系列。

注解

示例

/**
 * This sample produces a line chart with two series.
 * The chart assumes data in A1:E5 that looks like this:
 * Product Qtr1 Qtr2 Qtr3 Qtr4
 * Frames 5000 7000 6544 4377
 * Saddles 400 323 276 651
 */
function main(workbook: ExcelScript.Workbook) {
  // Establish the ranges to use.
  const sheet = workbook.getActiveWorksheet();
  const headerRange = sheet.getRange("A1:E1");
  const firstSeriesRange = sheet.getRange("A2:E2");
  const secondSeriesRange = sheet.getRange("A3:E3");

  // Create the chart.
  const lineChart = sheet.addChart(ExcelScript.ChartType.line, headerRange);

  // Add the first chart series.
  const firstSeries = lineChart.addChartSeries();
  firstSeries.setXAxisValues(headerRange);
  firstSeries.setValues(firstSeriesRange);

  // Add the second chart series.
  const secondSeries = lineChart.addChartSeries();
  secondSeries.setXAxisValues(headerRange);
  secondSeries.setValues(secondSeriesRange);
}

方法

addChartTrendline(type)

向趋势线集合添加新的趋势线。

delete()

删除 chart series 对象。

getAxisGroup()

指定指定系列的组。

getBinOptions()

封装直方图和排列图的容器选项。

getBoxwhiskerOptions()

封装箱形图的选项。

getBubbleScale()

这可以是从 0(零)到 300 的整数值,表示默认大小的百分比。 该属性仅适用于气泡图。

getChartTrendline(index)

按索引获取趋势线对象,这是 items 数组中的插入顺序。

getChartType()

表示系列的图表类型。 有关详细信息,请参阅 ExcelScript.ChartType

getDataLabels()

表示系列中的所有数据标签的集合。

getDimensionDataSourceString(dimension)

获取图表系列数据源的字符串表示形式。 字符串表示形式可以是单元格地址等信息。

getDimensionDataSourceType(dimension)

获取图表系列的数据源类型。

getDimensionValues(dimension)

从图表系列的单个维度获取值。 这些值可以是类别值或数据值,具体取决于指定的维度以及图表系列数据的映射方式。

getDoughnutHoleSize()

表示图表系列的圆环孔大小。 仅适用于圆环图和圆环图分解图。 在 InvalidArgument 无效图表上引发错误。

getExplosion()

指定饼图或圆环图切片的爆炸值。 如果未分解(切片尖端位于饼图中心),则返回 0(零)。

getFiltered()

指定是否筛选序列。 不适用于曲面图。

getFirstSliceAngle()

指定第一个饼图或圆环图切片的角度,以度为单位, (垂直) 顺时针。 只适用于饼图、三维饼图和圆环图。 可以是 0 到 360 之间的值。

getFormat()

表示图表系列的格式,包括填充和线条格式。

getGapWidth()

表示图表系列的间隙宽度。 仅适用于条形图和柱形图,以及折线图和饼图的特定类。 在无效图表上引发无效参数异常。

getGradientMaximumColor()

指定区域地图图表系列最大值的颜色。

getGradientMaximumType()

指定区域地图图表系列最大值的类型。

getGradientMaximumValue()

指定区域地图图表系列的最大值。

getGradientMidpointColor()

指定区域地图图表系列的中点值的颜色。

getGradientMidpointType()

指定区域地图图表系列的中点值的类型。

getGradientMidpointValue()

指定区域地图图表系列的中点值。

getGradientMinimumColor()

指定区域地图图表系列的最小值的颜色。

getGradientMinimumType()

指定区域地图图表系列的最小值的类型。

getGradientMinimumValue()

指定区域地图图表系列的最小值。

getGradientStyle()

指定区域地图图表的系列渐变样式。

getHasDataLabels()

指定序列是否具有数据标签。

getInvertColor()

指定序列中负数据点的填充颜色。

getInvertIfNegative()

如此 如果 Excel 反转项中的模式时它对应于负数。

getMapOptions()

封装区域地图图表的选项。

getMarkerBackgroundColor()

指定图表系列的标记背景色。

getMarkerForegroundColor()

指定图表系列的标记前景色。

getMarkerSize()

指定图表系列的标记大小。

getMarkerStyle()

指定图表系列的标记样式。 有关详细信息,请参阅 ExcelScript.ChartMarkerStyle

getName()

指定图表中序列的名称。 名称的长度不应大于 255 个字符。

getOverlap()

指定条柱的摆放方式。 可以是 -100 到 100 之间的值。 只适用于二维条形图和二维柱形图。

getParentLabelStrategy()

指定树状图的系列父标签策略区域。

getPlotOrder()

指定图表组中图表系列的绘图顺序。

getPoints()

返回序列中所有点的集合。

getSecondPlotSize()

以主饼图大小百分比的形式指定饼图或饼图条形图的次要部分的大小。 可以是 5 到 200 之间的值。

getShowConnectorLines()

指定是否在瀑布图中显示连接线。

getShowLeaderLines()

指定是否为系列中的每个数据标签显示前导线。

getShowShadow()

指定序列是否具有阴影。

getSmooth()

指定序列是否平滑。 仅适用于折线图和散点图。

getSplitType()

指定饼图或饼图条形图的两个部分的拆分方式。

getSplitValue()

指定用于分隔饼图或饼条形图的两个部分的阈值。

getTrendlines()

系列中趋势线的集合。

getVaryByCategories()

如果 Excel 为每个数据标记分配不同的颜色或图案,则为 True。 图表必须只包含一个系列。

getXErrorBars()

表示图表系列的误差线对象。

getYErrorBars()

表示图表系列的误差线对象。

setAxisGroup(axisGroup)

指定指定系列的组。

setBubbleScale(bubbleScale)

这可以是从 0(零)到 300 的整数值,表示默认大小的百分比。 该属性仅适用于气泡图。

setBubbleSizes(sourceData)

设置图表系列的气泡大小。 仅适用于气泡图。

setChartType(chartType)

表示系列的图表类型。 有关详细信息,请参阅 ExcelScript.ChartType

setDoughnutHoleSize(doughnutHoleSize)

表示图表系列的圆环孔大小。 仅适用于圆环图和圆环图分解图。 在 InvalidArgument 无效图表上引发错误。

setExplosion(explosion)

指定饼图或圆环图切片的爆炸值。 如果未分解(切片尖端位于饼图中心),则返回 0(零)。

setFiltered(filtered)

指定是否筛选序列。 不适用于曲面图。

setFirstSliceAngle(firstSliceAngle)

指定第一个饼图或圆环图切片的角度,以度为单位, (垂直) 顺时针。 只适用于饼图、三维饼图和圆环图。 可以是 0 到 360 之间的值。

setGapWidth(gapWidth)

表示图表系列的间隙宽度。 仅适用于条形图和柱形图,以及折线图和饼图的特定类。 在无效图表上引发无效参数异常。

setGradientMaximumColor(gradientMaximumColor)

指定区域地图图表系列最大值的颜色。

setGradientMaximumType(gradientMaximumType)

指定区域地图图表系列最大值的类型。

setGradientMaximumValue(gradientMaximumValue)

指定区域地图图表系列的最大值。

setGradientMidpointColor(gradientMidpointColor)

指定区域地图图表系列的中点值的颜色。

setGradientMidpointType(gradientMidpointType)

指定区域地图图表系列的中点值的类型。

setGradientMidpointValue(gradientMidpointValue)

指定区域地图图表系列的中点值。

setGradientMinimumColor(gradientMinimumColor)

指定区域地图图表系列的最小值的颜色。

setGradientMinimumType(gradientMinimumType)

指定区域地图图表系列的最小值的类型。

setGradientMinimumValue(gradientMinimumValue)

指定区域地图图表系列的最小值。

setGradientStyle(gradientStyle)

指定区域地图图表的系列渐变样式。

setHasDataLabels(hasDataLabels)

指定序列是否具有数据标签。

setInvertColor(invertColor)

指定序列中负数据点的填充颜色。

setInvertIfNegative(invertIfNegative)

如此 如果 Excel 反转项中的模式时它对应于负数。

setMarkerBackgroundColor(markerBackgroundColor)

指定图表系列的标记背景色。

setMarkerForegroundColor(markerForegroundColor)

指定图表系列的标记前景色。

setMarkerSize(markerSize)

指定图表系列的标记大小。

setMarkerStyle(markerStyle)

指定图表系列的标记样式。 有关详细信息,请参阅 ExcelScript.ChartMarkerStyle

setName(name)

指定图表中序列的名称。 名称的长度不应大于 255 个字符。

setOverlap(overlap)

指定条柱的摆放方式。 可以是 -100 到 100 之间的值。 只适用于二维条形图和二维柱形图。

setParentLabelStrategy(parentLabelStrategy)

指定树状图的系列父标签策略区域。

setPlotOrder(plotOrder)

指定图表组中图表系列的绘图顺序。

setSecondPlotSize(secondPlotSize)

以主饼图大小百分比的形式指定饼图或饼图条形图的次要部分的大小。 可以是 5 到 200 之间的值。

setShowConnectorLines(showConnectorLines)

指定是否在瀑布图中显示连接线。

setShowLeaderLines(showLeaderLines)

指定是否为系列中的每个数据标签显示前导线。

setShowShadow(showShadow)

指定序列是否具有阴影。

setSmooth(smooth)

指定序列是否平滑。 仅适用于折线图和散点图。

setSplitType(splitType)

指定饼图或饼图条形图的两个部分的拆分方式。

setSplitValue(splitValue)

指定用于分隔饼图或饼条形图的两个部分的阈值。

setValues(sourceData)

设置图表系列的值。 对于散点图,它指的是 y 轴值。

setVaryByCategories(varyByCategories)

如果 Excel 为每个数据标记分配不同的颜色或图案,则为 True。 图表必须只包含一个系列。

setXAxisValues(sourceData)

设置图表系列的 x 轴值。

方法详细信息

addChartTrendline(type)

向趋势线集合添加新的趋势线。

addChartTrendline(type?: ChartTrendlineType): ChartTrendline;

参数

type
ExcelScript.ChartTrendlineType

指定趋势线类型。 默认值为“Linear”。 有关详细信息,请参阅 ExcelScript.ChartTrendline

返回

delete()

删除 chart series 对象。

delete(): void;

返回

void

getAxisGroup()

指定指定系列的组。

getAxisGroup(): ChartAxisGroup;

返回

getBinOptions()

封装直方图和排列图的容器选项。

getBinOptions(): ChartBinOptions;

返回

getBoxwhiskerOptions()

封装箱形图的选项。

getBoxwhiskerOptions(): ChartBoxwhiskerOptions;

返回

getBubbleScale()

这可以是从 0(零)到 300 的整数值,表示默认大小的百分比。 该属性仅适用于气泡图。

getBubbleScale(): number;

返回

number

getChartTrendline(index)

按索引获取趋势线对象,这是 items 数组中的插入顺序。

getChartTrendline(index: number): ChartTrendline;

参数

index

number

表示 items 数组中的插入顺序。

返回

getChartType()

表示系列的图表类型。 有关详细信息,请参阅 ExcelScript.ChartType

getChartType(): ChartType;

返回

getDataLabels()

表示系列中的所有数据标签的集合。

getDataLabels(): ChartDataLabels;

返回

getDimensionDataSourceString(dimension)

获取图表系列数据源的字符串表示形式。 字符串表示形式可以是单元格地址等信息。

getDimensionDataSourceString(dimension: ChartSeriesDimension): string;

参数

dimension
ExcelScript.ChartSeriesDimension

数据所在轴的维度。

返回

string

getDimensionDataSourceType(dimension)

获取图表系列的数据源类型。

getDimensionDataSourceType(
            dimension: ChartSeriesDimension
        ): ChartDataSourceType;

参数

dimension
ExcelScript.ChartSeriesDimension

数据所在轴的维度。

返回

getDimensionValues(dimension)

从图表系列的单个维度获取值。 这些值可以是类别值或数据值,具体取决于指定的维度以及图表系列数据的映射方式。

getDimensionValues(dimension: ChartSeriesDimension): string[];

参数

dimension
ExcelScript.ChartSeriesDimension

数据所在轴的维度。

返回

string[]

getDoughnutHoleSize()

表示图表系列的圆环孔大小。 仅适用于圆环图和圆环图分解图。 在 InvalidArgument 无效图表上引发错误。

getDoughnutHoleSize(): number;

返回

number

getExplosion()

指定饼图或圆环图切片的爆炸值。 如果未分解(切片尖端位于饼图中心),则返回 0(零)。

getExplosion(): number;

返回

number

getFiltered()

指定是否筛选序列。 不适用于曲面图。

getFiltered(): boolean;

返回

boolean

getFirstSliceAngle()

指定第一个饼图或圆环图切片的角度,以度为单位, (垂直) 顺时针。 只适用于饼图、三维饼图和圆环图。 可以是 0 到 360 之间的值。

getFirstSliceAngle(): number;

返回

number

getFormat()

表示图表系列的格式,包括填充和线条格式。

getFormat(): ChartSeriesFormat;

返回

getGapWidth()

表示图表系列的间隙宽度。 仅适用于条形图和柱形图,以及折线图和饼图的特定类。 在无效图表上引发无效参数异常。

getGapWidth(): number;

返回

number

getGradientMaximumColor()

指定区域地图图表系列最大值的颜色。

getGradientMaximumColor(): string;

返回

string

getGradientMaximumType()

指定区域地图图表系列最大值的类型。

getGradientMaximumType(): ChartGradientStyleType;

返回

getGradientMaximumValue()

指定区域地图图表系列的最大值。

getGradientMaximumValue(): number;

返回

number

getGradientMidpointColor()

指定区域地图图表系列的中点值的颜色。

getGradientMidpointColor(): string;

返回

string

getGradientMidpointType()

指定区域地图图表系列的中点值的类型。

getGradientMidpointType(): ChartGradientStyleType;

返回

getGradientMidpointValue()

指定区域地图图表系列的中点值。

getGradientMidpointValue(): number;

返回

number

getGradientMinimumColor()

指定区域地图图表系列的最小值的颜色。

getGradientMinimumColor(): string;

返回

string

getGradientMinimumType()

指定区域地图图表系列的最小值的类型。

getGradientMinimumType(): ChartGradientStyleType;

返回

getGradientMinimumValue()

指定区域地图图表系列的最小值。

getGradientMinimumValue(): number;

返回

number

getGradientStyle()

指定区域地图图表的系列渐变样式。

getGradientStyle(): ChartGradientStyle;

返回

getHasDataLabels()

指定序列是否具有数据标签。

getHasDataLabels(): boolean;

返回

boolean

getInvertColor()

指定序列中负数据点的填充颜色。

getInvertColor(): string;

返回

string

getInvertIfNegative()

如此 如果 Excel 反转项中的模式时它对应于负数。

getInvertIfNegative(): boolean;

返回

boolean

getMapOptions()

封装区域地图图表的选项。

getMapOptions(): ChartMapOptions;

返回

getMarkerBackgroundColor()

指定图表系列的标记背景色。

getMarkerBackgroundColor(): string;

返回

string

getMarkerForegroundColor()

指定图表系列的标记前景色。

getMarkerForegroundColor(): string;

返回

string

getMarkerSize()

指定图表系列的标记大小。

getMarkerSize(): number;

返回

number

getMarkerStyle()

指定图表系列的标记样式。 有关详细信息,请参阅 ExcelScript.ChartMarkerStyle

getMarkerStyle(): ChartMarkerStyle;

返回

getName()

指定图表中序列的名称。 名称的长度不应大于 255 个字符。

getName(): string;

返回

string

示例

/**
 * This sample logs the names of each of the chart series in a chart named "ColumnClusteredChart".
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the current worksheet.
  let selectedSheet = workbook.getActiveWorksheet();

  // Get an existing chart named "ColumnClusteredChart".
  let chart = selectedSheet.getChart("ColumnClusteredChart");

  // Log the name of each chart series in the chart.
  let seriesList = chart.getSeries();
  seriesList.forEach((series) => {
    console.log(series.getName());
  });
}

getOverlap()

指定条柱的摆放方式。 可以是 -100 到 100 之间的值。 只适用于二维条形图和二维柱形图。

getOverlap(): number;

返回

number

getParentLabelStrategy()

指定树状图的系列父标签策略区域。

getParentLabelStrategy(): ChartParentLabelStrategy;

返回

getPlotOrder()

指定图表组中图表系列的绘图顺序。

getPlotOrder(): number;

返回

number

getPoints()

返回序列中所有点的集合。

getPoints(): ChartPoint[];

返回

getSecondPlotSize()

以主饼图大小百分比的形式指定饼图或饼图条形图的次要部分的大小。 可以是 5 到 200 之间的值。

getSecondPlotSize(): number;

返回

number

getShowConnectorLines()

指定是否在瀑布图中显示连接线。

getShowConnectorLines(): boolean;

返回

boolean

getShowLeaderLines()

指定是否为系列中的每个数据标签显示前导线。

getShowLeaderLines(): boolean;

返回

boolean

getShowShadow()

指定序列是否具有阴影。

getShowShadow(): boolean;

返回

boolean

getSmooth()

指定序列是否平滑。 仅适用于折线图和散点图。

getSmooth(): boolean;

返回

boolean

getSplitType()

指定饼图或饼图条形图的两个部分的拆分方式。

getSplitType(): ChartSplitType;

返回

getSplitValue()

指定用于分隔饼图或饼条形图的两个部分的阈值。

getSplitValue(): number;

返回

number

getTrendlines()

系列中趋势线的集合。

getTrendlines(): ChartTrendline[];

返回

getVaryByCategories()

如果 Excel 为每个数据标记分配不同的颜色或图案,则为 True。 图表必须只包含一个系列。

getVaryByCategories(): boolean;

返回

boolean

getXErrorBars()

表示图表系列的误差线对象。

getXErrorBars(): ChartErrorBars;

返回

getYErrorBars()

表示图表系列的误差线对象。

getYErrorBars(): ChartErrorBars;

返回

示例

/**
 * This script adds error bars for the standard error of each chart series point.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the range for the chart.
  const worksheet = workbook.getWorksheet("Sample");
  const dataRange = worksheet.getRange("A1:B15");

  // Create a line chart.
  const chart = worksheet.addChart(ExcelScript.ChartType.line, dataRange);

  // For each series, add error bars for the standard error on each point
  const allSeries = chart.getSeries();
  allSeries.forEach((series) => {
    series.getYErrorBars().setType(ExcelScript.ChartErrorBarsType.stError);
    series.getYErrorBars().setVisible(true);
  });
}

setAxisGroup(axisGroup)

指定指定系列的组。

setAxisGroup(axisGroup: ChartAxisGroup): void;

参数

返回

void

setBubbleScale(bubbleScale)

这可以是从 0(零)到 300 的整数值,表示默认大小的百分比。 该属性仅适用于气泡图。

setBubbleScale(bubbleScale: number): void;

参数

bubbleScale

number

返回

void

setBubbleSizes(sourceData)

设置图表系列的气泡大小。 仅适用于气泡图。

setBubbleSizes(sourceData: Range): void;

参数

sourceData
ExcelScript.Range

对应于 Range 源数据的对象。

返回

void

setChartType(chartType)

表示系列的图表类型。 有关详细信息,请参阅 ExcelScript.ChartType

setChartType(chartType: ChartType): void;

参数

返回

void

setDoughnutHoleSize(doughnutHoleSize)

表示图表系列的圆环孔大小。 仅适用于圆环图和圆环图分解图。 在 InvalidArgument 无效图表上引发错误。

setDoughnutHoleSize(doughnutHoleSize: number): void;

参数

doughnutHoleSize

number

返回

void

setExplosion(explosion)

指定饼图或圆环图切片的爆炸值。 如果未分解(切片尖端位于饼图中心),则返回 0(零)。

setExplosion(explosion: number): void;

参数

explosion

number

返回

void

setFiltered(filtered)

指定是否筛选序列。 不适用于曲面图。

setFiltered(filtered: boolean): void;

参数

filtered

boolean

返回

void

setFirstSliceAngle(firstSliceAngle)

指定第一个饼图或圆环图切片的角度,以度为单位, (垂直) 顺时针。 只适用于饼图、三维饼图和圆环图。 可以是 0 到 360 之间的值。

setFirstSliceAngle(firstSliceAngle: number): void;

参数

firstSliceAngle

number

返回

void

setGapWidth(gapWidth)

表示图表系列的间隙宽度。 仅适用于条形图和柱形图,以及折线图和饼图的特定类。 在无效图表上引发无效参数异常。

setGapWidth(gapWidth: number): void;

参数

gapWidth

number

返回

void

setGradientMaximumColor(gradientMaximumColor)

指定区域地图图表系列最大值的颜色。

setGradientMaximumColor(gradientMaximumColor: string): void;

参数

gradientMaximumColor

string

返回

void

setGradientMaximumType(gradientMaximumType)

指定区域地图图表系列最大值的类型。

setGradientMaximumType(
            gradientMaximumType: ChartGradientStyleType
        ): void;

参数

返回

void

setGradientMaximumValue(gradientMaximumValue)

指定区域地图图表系列的最大值。

setGradientMaximumValue(gradientMaximumValue: number): void;

参数

gradientMaximumValue

number

返回

void

setGradientMidpointColor(gradientMidpointColor)

指定区域地图图表系列的中点值的颜色。

setGradientMidpointColor(gradientMidpointColor: string): void;

参数

gradientMidpointColor

string

返回

void

setGradientMidpointType(gradientMidpointType)

指定区域地图图表系列的中点值的类型。

setGradientMidpointType(
            gradientMidpointType: ChartGradientStyleType
        ): void;

参数

gradientMidpointType
ExcelScript.ChartGradientStyleType

返回

void

setGradientMidpointValue(gradientMidpointValue)

指定区域地图图表系列的中点值。

setGradientMidpointValue(gradientMidpointValue: number): void;

参数

gradientMidpointValue

number

返回

void

setGradientMinimumColor(gradientMinimumColor)

指定区域地图图表系列的最小值的颜色。

setGradientMinimumColor(gradientMinimumColor: string): void;

参数

gradientMinimumColor

string

返回

void

setGradientMinimumType(gradientMinimumType)

指定区域地图图表系列的最小值的类型。

setGradientMinimumType(
            gradientMinimumType: ChartGradientStyleType
        ): void;

参数

返回

void

setGradientMinimumValue(gradientMinimumValue)

指定区域地图图表系列的最小值。

setGradientMinimumValue(gradientMinimumValue: number): void;

参数

gradientMinimumValue

number

返回

void

setGradientStyle(gradientStyle)

指定区域地图图表的系列渐变样式。

setGradientStyle(gradientStyle: ChartGradientStyle): void;

参数

返回

void

setHasDataLabels(hasDataLabels)

指定序列是否具有数据标签。

setHasDataLabels(hasDataLabels: boolean): void;

参数

hasDataLabels

boolean

返回

void

setInvertColor(invertColor)

指定序列中负数据点的填充颜色。

setInvertColor(invertColor: string): void;

参数

invertColor

string

返回

void

setInvertIfNegative(invertIfNegative)

如此 如果 Excel 反转项中的模式时它对应于负数。

setInvertIfNegative(invertIfNegative: boolean): void;

参数

invertIfNegative

boolean

返回

void

setMarkerBackgroundColor(markerBackgroundColor)

指定图表系列的标记背景色。

setMarkerBackgroundColor(markerBackgroundColor: string): void;

参数

markerBackgroundColor

string

返回

void

setMarkerForegroundColor(markerForegroundColor)

指定图表系列的标记前景色。

setMarkerForegroundColor(markerForegroundColor: string): void;

参数

markerForegroundColor

string

返回

void

setMarkerSize(markerSize)

指定图表系列的标记大小。

setMarkerSize(markerSize: number): void;

参数

markerSize

number

返回

void

setMarkerStyle(markerStyle)

指定图表系列的标记样式。 有关详细信息,请参阅 ExcelScript.ChartMarkerStyle

setMarkerStyle(markerStyle: ChartMarkerStyle): void;

参数

返回

void

setName(name)

指定图表中序列的名称。 名称的长度不应大于 255 个字符。

setName(name: string): void;

参数

name

string

返回

void

setOverlap(overlap)

指定条柱的摆放方式。 可以是 -100 到 100 之间的值。 只适用于二维条形图和二维柱形图。

setOverlap(overlap: number): void;

参数

overlap

number

返回

void

示例

/**
 * This sample sets the overlap of the columns in a chart named "ColumnClusteredChart".
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the current worksheet.
  let selectedSheet = workbook.getActiveWorksheet();

  // Get an existing chart named "ColumnClusteredChart".
  let chart = selectedSheet.getChart("ColumnClusteredChart");

  // Set the overlap of every column of each series within a category.
  let seriesList = chart.getSeries();
  seriesList.forEach((series) => {
    // An overlap of 25 means the columns have 25% of their length overlapping with the adjacent columns in the same category.
    series.setOverlap(25);
  });
}

setParentLabelStrategy(parentLabelStrategy)

指定树状图的系列父标签策略区域。

setParentLabelStrategy(
            parentLabelStrategy: ChartParentLabelStrategy
        ): void;

参数

返回

void

setPlotOrder(plotOrder)

指定图表组中图表系列的绘图顺序。

setPlotOrder(plotOrder: number): void;

参数

plotOrder

number

返回

void

setSecondPlotSize(secondPlotSize)

以主饼图大小百分比的形式指定饼图或饼图条形图的次要部分的大小。 可以是 5 到 200 之间的值。

setSecondPlotSize(secondPlotSize: number): void;

参数

secondPlotSize

number

返回

void

setShowConnectorLines(showConnectorLines)

指定是否在瀑布图中显示连接线。

setShowConnectorLines(showConnectorLines: boolean): void;

参数

showConnectorLines

boolean

返回

void

setShowLeaderLines(showLeaderLines)

指定是否为系列中的每个数据标签显示前导线。

setShowLeaderLines(showLeaderLines: boolean): void;

参数

showLeaderLines

boolean

返回

void

setShowShadow(showShadow)

指定序列是否具有阴影。

setShowShadow(showShadow: boolean): void;

参数

showShadow

boolean

返回

void

setSmooth(smooth)

指定序列是否平滑。 仅适用于折线图和散点图。

setSmooth(smooth: boolean): void;

参数

smooth

boolean

返回

void

setSplitType(splitType)

指定饼图或饼图条形图的两个部分的拆分方式。

setSplitType(splitType: ChartSplitType): void;

参数

返回

void

setSplitValue(splitValue)

指定用于分隔饼图或饼条形图的两个部分的阈值。

setSplitValue(splitValue: number): void;

参数

splitValue

number

返回

void

setValues(sourceData)

设置图表系列的值。 对于散点图,它指的是 y 轴值。

setValues(sourceData: Range): void;

参数

sourceData
ExcelScript.Range

对应于 Range 源数据的对象。

返回

void

setVaryByCategories(varyByCategories)

如果 Excel 为每个数据标记分配不同的颜色或图案,则为 True。 图表必须只包含一个系列。

setVaryByCategories(varyByCategories: boolean): void;

参数

varyByCategories

boolean

返回

void

setXAxisValues(sourceData)

设置图表系列的 x 轴值。

setXAxisValues(sourceData: Range): void;

参数

sourceData
ExcelScript.Range

对应于 Range 源数据的对象。

返回

void