ExcelScript.ChartAxes interface
Représente les axes du graphique.
Remarques
Exemples
/**
* 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éthode
| get |
Représente l’axe des abscisses d’un graphique. |
| get |
Renvoie l’axe spécifique identifié par type et par groupe. |
| get |
Représente l’axe des séries d’un graphique 3D. |
| get |
Représente l’axe des ordonnées. |
Détails de la méthode
getCategoryAxis()
Représente l’axe des abscisses d’un graphique.
getCategoryAxis(): ChartAxis;
Retourne
Exemples
/**
* 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)
Renvoie l’axe spécifique identifié par type et par groupe.
getChartAxis(type: ChartAxisType, group?: ChartAxisGroup): ChartAxis;
Paramètres
Spécifie le type d’axe. Pour plus d’informations, consultez ExcelScript.ChartAxisType .
Facultatif. Spécifie le groupe d'axes. Pour plus d’informations, consultez ExcelScript.ChartAxisGroup .
Retourne
getSeriesAxis()
Représente l’axe des séries d’un graphique 3D.
getSeriesAxis(): ChartAxis;
Retourne
getValueAxis()
Représente l’axe des ordonnées.
getValueAxis(): ChartAxis;
Retourne
Exemples
/**
* 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);
}