ExcelScript.ChartPlotBy enum
注解
示例
/**
* This sample performs the "Switch Row/Column" action on a chart named "ColumnClusteredChart".
*/
function main(workbook: ExcelScript.Workbook) {
// Get the current worksheet.
let selectedSheet = workbook.getActiveWorksheet();
// Get an existing chart named "ColumnClusteredChart".
let columnClusteredChart = selectedSheet.getChart("ColumnClusteredChart");
// Switch the row and column for the chart's data source.
if (columnClusteredChart.getPlotBy() === ExcelScript.ChartPlotBy.columns) {
// If the chart is grouped by columns, switch it to rows.
columnClusteredChart.setPlotBy(ExcelScript.ChartPlotBy.rows);
} else {
// If the chart is grouped by rows, switch it to columns.
columnClusteredChart.setPlotBy(ExcelScript.ChartPlotBy.columns);
}
}
字段
columns | |
rows |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈