Excel.ChartSeriesDimension enum

表示从图表系列获取值时的维度。

注解

[ API 集:ExcelApi 1.12 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-bubble-chart.yaml

await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getItem("Sample");

  // The sample chart is of type `Excel.ChartType.bubble`.
  const bubbleChart = sheet.charts.getItem("Product Chart");

  // Get the first series in the chart.
  const firstSeries = bubbleChart.series.getItemAt(0);

  // Get the values for the dimensions we're interested in.
  const bubbleSize = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.bubbleSizes);
  const xValues = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.xvalues);
  const yValues = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.yvalues);
  const category = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.categories);

  await context.sync();

  // Log the information.
  console.log(`Series ${category.value} - X:${xValues.value},Y:${yValues.value},Bubble:${bubbleSize.value}`);
});

字段

bubbleSizes = "BubbleSizes"

气泡图中气泡大小的图表系列轴。

categories = "Categories"

类别的图表系列轴。

values = "Values"

值的图表系列轴。

xvalues = "XValues"

散点图和气泡图中 x 轴值的图表系列轴。

yvalues = "YValues"

散点图和气泡图中 y 轴值的图表系列轴。