ExcelScript.ChartFill interface
グラフ要素の塗りつぶしの書式設定を表します。
注釈
例
/**
* This sample sets the fill color of a chart series.
* This assumes the active worksheet has a stock chart (e.g., Volume-High-Low-Close).
*/
function main(workbook: ExcelScript.Workbook) {
// Get the first chart on the active worksheet.
const sheet = workbook.getActiveWorksheet();
const chart = sheet.getCharts()[0];
// Set the fill color for the first series (volume).
const volumeSeries = chart.getSeries()[0];
volumeSeries.getFormat().getFill().setSolidColor("#B0C4DE");
}
メソッド
| clear() | グラフ要素の塗りつぶしの色をクリアします。 |
| get |
グラフ要素の均一な色の塗りつぶしの書式設定を取得します。 |
| set |
グラフ要素の塗りつぶしの書式設定を均一な色に設定します。 |
メソッドの詳細
clear()
グラフ要素の塗りつぶしの色をクリアします。
clear(): void;
戻り値
void
getSolidColor()
グラフ要素の均一な色の塗りつぶしの書式設定を取得します。
getSolidColor(): string;
戻り値
string
setSolidColor(color)
グラフ要素の塗りつぶしの書式設定を均一な色に設定します。
setSolidColor(color: string): void;
パラメーター
- color
-
string
背景の色を表す HTML カラー コードは、#RRGGBB 形式 (例: "FFA500") または名前付き HTML カラー (例: "オレンジ") として表されます。
戻り値
void
例
/**
* This sample sets a solid fill color for a chart series.
* This assumes the active worksheet has a stock chart (e.g., Volume-Open-High-Low-Close).
*/
function main(workbook: ExcelScript.Workbook) {
// Get the first chart on the active worksheet.
const sheet = workbook.getActiveWorksheet();
const chart = sheet.getCharts()[0];
// Set the fill color to light steel blue for the first series.
const volumeSeries = chart.getSeries()[0];
volumeSeries.getFormat().getFill().setSolidColor("#B0C4DE");
}