次の方法で共有


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()

3-D グラフの系列軸を表します。

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()

3-D グラフの系列軸を表します。

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