Represents the legend in a chart. Each chart can have only one legend.

Legend

new Legend(): Legend

Returns Legend

Determines the appearance of the border drawn around the text area, as well as whether a border appears.

get border(): ChartBorder

Returns ChartBorder

set border(a: ChartBorder): void

Parameters

Returns void

Inherited from: ChartObject

Returns the owning chart (read-only)

get chart(): WorksheetChart

Returns WorksheetChart

Defines the font properties for legend entries which have no specific font settings. Read-only.

get defaultFont(): IWorkbookFont

Returns IWorkbookFont

Returns or sets a [[ChartFillBase]] derived object which defines the font color(s) for legend entries.

get defaultFontFill(): ChartFillBase

Returns ChartFillBase

set defaultFontFill(a: ChartFillBase): void

Parameters

Returns void

Returns or sets a [[ChartFillBase]] derived object which defines the fill properties for the legend's text area.

get fill(): ChartFillBase

Returns ChartFillBase

set fill(a: ChartFillBase): void

Parameters

Returns void

Returns or sets a value that represents the height of the legend area, expressed as a fraction of the chart area's height.

get height(): number

Returns number

set height(a: number): void

Parameters

  • a: number

Returns void

Returns or sets a value that represents the position of the left edge of the legend area, expressed as a fraction of the chart area's width.

get left(): number

Returns number

set left(a: number): void

Parameters

  • a: number

Returns void

Returns or sets a boolean value indicating whether the legend can intersect with the chart's plot area.

get overlay(): boolean

Returns boolean

set overlay(a: boolean): void

Parameters

  • a: boolean

Returns void

Inherited from: ChartObject

returns this object's owner. (read-only) The owner or null if this object is owned directly by the Chart

get owner(): ChartObject

Returns ChartObject

Returns or sets a value that represents the position of the legend on the chart.

get position(): LegendPosition

Returns LegendPosition

set position(a: LegendPosition): void

Parameters

Returns void

Determines the rotation of the legend's text area, expressed in degrees.

get rotation(): number

Returns number

set rotation(a: number): void

Parameters

  • a: number

Returns void

Inherited from: ChartObject

The owning sheet (read-only)

get sheet(): Sheet

Returns Sheet

Determines the orientation and direction in which text flows.

get textDirection(): TextDirection

Returns TextDirection

set textDirection(a: TextDirection): void

Parameters

Returns void

Returns or sets a value that represents the position of the top edge of the legend area, expressed as a fraction of the chart area's height.

get top(): number

Returns number

set top(a: number): void

Parameters

  • a: number

Returns void

Returns or sets a value that represents the width of the legend area, expressed as a fraction of the chart area's width.

get width(): number

Returns number

set width(a: number): void

Parameters

  • a: number

Returns void

Inherited from: ChartObject

The owning workbook (read-only)

get workbook(): Workbook

Returns Workbook

Inherited from: ChartObject

The owning worksheet (read-only)

get worksheet(): Worksheet

Returns Worksheet

Indexer (read-only)

legendEntries(index: number): LegendEntry

Parameters

  • index: number

    A zero based index

Returns LegendEntry