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);
}
メソッド
| get |
グラフの項目軸を表します。 |
| get |
種類とグループで識別された特定の軸を返します。 |
| get |
3-D グラフの系列軸を表します。 |
| get |
軸の数値軸を表します。 |
メソッドの詳細
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;
パラメーター
軸の種類を指定します。 詳細は「ExcelScript.ChartAxisType」をご覧ください。
省略可能。 軸のグループを指定します。 詳細は「ExcelScript.ChartAxisGroup」をご覧ください。
戻り値
getSeriesAxis()
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);
}