Поделиться через


ExcelScript.ChartAxes interface

Представляет оси диаграммы.

Замечания

Примеры

/**
 * This sample gets the chart axes and customizes them.
 * This assumes the active worksheet has a chart.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the first chart on the active worksheet.
  const sheet = workbook.getActiveWorksheet();
  const chart = sheet.getCharts()[0];
  
  // Access and customize the axes.
  const axes = chart.getAxes();
  axes.getValueAxis().setDisplayUnit(ExcelScript.ChartAxisDisplayUnit.thousands);
  axes.getCategoryAxis().setVisible(true);
}

Методика

getCategoryAxis()

Представляет ось категорий на диаграмме.

getChartAxis(type, group)

Возвращает указанную ось, определенную по типу и группе.

getSeriesAxis()

Представляет ось рядов трехмерной диаграммы.

getValueAxis()

Представляет ось значений для оси.

Подробнее о методе

getCategoryAxis()

Представляет ось категорий на диаграмме.

getCategoryAxis(): ChartAxis;

Возвращает

Примеры

/**
 * This sample gets and customizes the category axis.
 * This assumes the active worksheet has a chart.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the first chart on the active worksheet.
  const sheet = workbook.getActiveWorksheet();
  const chart = sheet.getCharts()[0];
  
  // Get and customize the category axis.
  const categoryAxis = chart.getAxes().getCategoryAxis();
  categoryAxis.setTickLabelPosition(ExcelScript.ChartAxisTickLabelPosition.low);
}

getChartAxis(type, group)

Возвращает указанную ось, определенную по типу и группе.

getChartAxis(type: ChartAxisType, group?: ChartAxisGroup): ChartAxis;

Параметры

type
ExcelScript.ChartAxisType

Указывает тип оси. Дополнительные сведения см. в этой ExcelScript.ChartAxisType статье.

group
ExcelScript.ChartAxisGroup

Необязательный параметр. Указывает группу осей. Дополнительные сведения см. в этой ExcelScript.ChartAxisGroup статье.

Возвращает

getSeriesAxis()

Представляет ось рядов трехмерной диаграммы.

getSeriesAxis(): ChartAxis;

Возвращает

getValueAxis()

Представляет ось значений для оси.

getValueAxis(): ChartAxis;

Возвращает

Примеры

/**
 * This sample gets and customizes the value axis.
 * This assumes the active worksheet has a chart.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the first chart on the active worksheet.
  const sheet = workbook.getActiveWorksheet();
  const chart = sheet.getCharts()[0];
  
  // Get and customize the value axis.
  const valueAxis = chart.getAxes().getValueAxis();
  valueAxis.setDisplayUnit(ExcelScript.ChartAxisDisplayUnit.thousands);
  valueAxis.setMinimum(40000);
  valueAxis.setMaximum(60000);
}