ExcelScript.ChartFill interface
Представляет форматирование заливки для элемента диаграммы.
Комментарии
Используется
- ExcelScript.ChartAreaFormat: getFill
- ExcelScript.ChartAxisFormat: getFill
- ExcelScript.ChartAxisTitleFormat: getFill
- ExcelScript.ChartDataLabelFormat: getFill
- ExcelScript.ChartDataTableFormat: getFill
- ExcelScript.ChartLegendFormat: getFill
- ExcelScript.ChartPlotAreaFormat: getFill
- ExcelScript.ChartPointFormat: getFill
- ExcelScript.ChartSeriesFormat: getFill
- ExcelScript.ChartTitleFormat: getFill
- ExcelScript.ChartTrendlineLabelFormat: getFill
Примеры
/**
* 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");
}