存取工作表中的圖表位置。可以使用 Embedded
函式更新。
const sheet = SpreadsheetApp.getActiveSheet(); const chart = sheet.getCharts()[0]; const modifiedChart = chart.modify().setPosition(5, 5, 0, 0).build(); sheet.updateChart(modifiedChart);
方法
方法 | 傳回類型 | 簡短說明 |
---|---|---|
get | Integer | 圖表的左側會錨定在這個資料欄中。 |
get | Integer | 圖表的頂端會固定在這個資料列中。 |
get | Integer | 圖表左上角與錨定欄的偏移量 (以像素為單位)。 |
get | Integer | 圖表左上角與錨定列的偏移量 (以像素為單位)。 |
內容詳盡的說明文件
get Anchor Column()
圖表的左側會錨定在這個資料欄中。
回攻員
Integer
:以 1 為索引的資料欄 (也就是說,C 欄是 3)。
get Anchor Row()
圖表的頂端會固定在這個資料列中。
回攻員
Integer
:以 1 為起始的列 (也就是說,第 5 列會傳回 5)。
get Offset X()
圖表左上角與錨定欄的偏移量 (以像素為單位)。
回攻員
Integer
:圖表左上角的水平偏移量 (以像素為單位)。
get Offset Y()
圖表左上角與錨定列的偏移量 (以像素為單位)。
回攻員
Integer
:圖表左上角的垂直偏移量 (以像素為單位)。