Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ExcelScript.ChartFill interface

Package:
ExcelScript

Represents the fill formatting for a chart element.

Remarks

Used by

Examples

/**
 * 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");
}

Methods

clear()

Clears the fill color of a chart element.

getSolidColor()

Gets the uniform color fill formatting of a chart element.

setSolidColor(color)

Sets the fill formatting of a chart element to a uniform color.

Method Details

clear()

Clears the fill color of a chart element.

clear(): void;

Returns

void

getSolidColor()

Gets the uniform color fill formatting of a chart element.

getSolidColor(): string;

Returns

string

setSolidColor(color)

Sets the fill formatting of a chart element to a uniform color.

setSolidColor(color: string): void;

Parameters

color

string

HTML color code representing the color of the background, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange").

Returns

void

Examples

/**
 * 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");
}

Feedback

Was this page helpful?