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

Hierarchy

Hierarchy (view full)

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get border(): ChartBorder
  • Determines the appearance of the border drawn around the text area, as well as whether a border appears.

    Returns ChartBorder

  • set border(a): void
  • Parameters

    Returns void

  • get chart(): WorksheetChart
  • Returns the owning chart (read-only)

    See

    [[owner]]

    Returns WorksheetChart

  • get defaultFont(): IWorkbookFont
  • Defines the font properties for legend entries which have no specific font settings. Read-only.

    To apply font settings to a specific legend entry, use the [[LegendEntry.font]] property.

    Note: this property will return null until the [[Legend]] is set on the WorksheetChart.Legend property.

    See

    [[LegendEntry.font]]

    Returns IWorkbookFont

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

    Use this property to apply the same font color(s) to all legend entries.

    Use the [[LegendEntry.fontFill]] property to apply font color(s) for a particular legend entry.

    See

    • [[ChartSolidFill]]
    • [[ChartGradientFill]]

    Returns ChartFillBase

  • set defaultFontFill(a): void
  • Parameters

    Returns void

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

    This property returns null by default, indicating that no fill is applied.

    To apply a solid color fill, assign an instance of the [[ChartSolidFill]] class to this property.

    To apply a gradient fill, assign an instance of the [[ChartGradientFill]] class to this property.

    See

    • [[ChartSolidFill]]
    • [[ChartGradientFill]]

    Returns ChartFillBase

  • set fill(a): void
  • Parameters

    Returns void

  • get height(): number
  • Returns or sets a value that represents the height of the legend area, expressed as a fraction of the chart area's height.

    Valid values for this property range between zero and one, with a value of one representing the total height of the chart area.

    A value of .1 (for example) represents a height that is equal to one-tenth the height of the chart area.

    See

    [[width]]

    Returns number

  • set height(a): void
  • Parameters

    • a: number

    Returns void

  • get left(): number
  • 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.

    Valid values for this property range between zero and one, with a value of one representing the total width of the chart area.

    See

    [[top]]

    Returns number

  • set left(a): void
  • Parameters

    • a: number

    Returns void

  • get overlay(): boolean
  • Returns or sets a boolean value indicating whether the legend can intersect with the chart's plot area.

    Returns boolean

  • set overlay(a): void
  • Parameters

    • a: boolean

    Returns void

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

    See

    [[chart]]

    Returns ChartObject

  • get position(): LegendPosition
  • Returns or sets a value that represents the position of the legend on the chart.

    Returns LegendPosition

  • set position(a): void
  • Parameters

    Returns void

  • get rotation(): number
  • Determines the rotation of the legend's text area, expressed in degrees.

    Returns number

  • set rotation(a): void
  • Parameters

    • a: number

    Returns void

  • get sheet(): Sheet
  • The owning sheet (read-only)

    Returns Sheet

  • get textDirection(): TextDirection
  • Determines the orientation and direction in which text flows.

    Note that the [[rotation]] property is only applicable when this property is set to Horizontal.

    See

    [[rotation]]

    Returns TextDirection

  • set textDirection(a): void
  • Parameters

    Returns void

  • get top(): number
  • 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.

    Valid values for this property range between zero and one, with a value of one representing the total height of the chart area.

    See

    [[left]]

    Returns number

  • set top(a): void
  • Parameters

    • a: number

    Returns void

  • get width(): number
  • Returns or sets a value that represents the width of the legend area, expressed as a fraction of the chart area's width.

    Valid values for this property range between zero and one, with a value of one representing the total width of the chart area.

    See

    [[height]]

    Returns number

  • set width(a): void
  • Parameters

    • a: number

    Returns void

  • get workbook(): Workbook
  • The owning workbook (read-only)

    Returns Workbook

  • get worksheet(): Worksheet
  • The owning worksheet (read-only)

    Returns Worksheet

Methods

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Indexer (read-only)

    Parameters

    • index: number

      A zero based index

    Returns LegendEntry

  • Returns a read only collection of legend entries.

    This collection contains one entry for each [[Series]] in the associated chart's [[WorksheetChart.seriesCollection]].

    This collection does not include legend entries for trendlines.

    Use the [[Trendline.legendEntry]] property to obtain a reference to the legend entry associated with a trendline.

    See

    [[WorksheetChart.legend]]

    Returns LegendEntries

  • Returns Base

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean