Compartilhar via


ExcelScript.ChartAxes interface

Representa os eixos de um gráfico.

Comentários

Exemplos

/**
 * 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);
}

Métodos

getCategoryAxis()

Representa o eixo de categoria em um gráfico.

getChartAxis(type, group)

Retorna o eixo específico identificado por tipo e grupo.

getSeriesAxis()

Representa o eixo da série de um gráfico 3D.

getValueAxis()

Representa o eixo dos valores em um eixo.

Detalhes do método

getCategoryAxis()

Representa o eixo de categoria em um gráfico.

getCategoryAxis(): ChartAxis;

Retornos

Exemplos

/**
 * 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)

Retorna o eixo específico identificado por tipo e grupo.

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

Parâmetros

type
ExcelScript.ChartAxisType

Especifica o tipo de eixo. Veja ExcelScript.ChartAxisType para obter detalhes.

group
ExcelScript.ChartAxisGroup

Opcional. Especifica o grupo de eixos. Veja ExcelScript.ChartAxisGroup para obter detalhes.

Retornos

getSeriesAxis()

Representa o eixo da série de um gráfico 3D.

getSeriesAxis(): ChartAxis;

Retornos

getValueAxis()

Representa o eixo dos valores em um eixo.

getValueAxis(): ChartAxis;

Retornos

Exemplos

/**
 * 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);
}