Defines the properties for all data labels displayed for this [[Series]].

This property provides a way to set properties on multiple data labels.

Use the [[DataPoint.dataLabel]] property to customize an individual data label.

The property values of the [[DataPoint.dataLabel]] class take precedence over the properties of this class.

See

  • [[DataLabel]]
  • [[DataPoint.dataLabel]]
  • [[Series.dataPointCollection]]

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 dataLabelsRange(): Formula
  • Returns a [[Formula]] which defines the cell range from which part or all of the label text is obtained.

    Use the [[setDataLabelsRange]] method to assign a new value.

    The cell values obtained from this property are only displayed when the [[DataLabel.showRange]] property is set to true.

    The specified range must contain only one column or one row, or an exception is thrown.

    See

    • [[setDataLabelsRange]]
    • [[DataLabel.showRange]]

    Returns Formula

  • get defaultFont(): IWorkbookFont
  • Defines the font properties for each formatted run in the [[text]] that has no more specific setting. Read-only.

    Use this object to apply font formatting to the entire run of text which comprises the chart or axis title.

    Font formatting can be applied to individual runs of text using the [[FormattedString.getFont]] method of the object returned from the [[text]] property. Any such formatting overrides that which is defined by the DefaultFont settings.

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

    See

    • [[text]]
    • [[FormattedString]]

    Returns IWorkbookFont

  • get fill(): ChartFillBase
  • Returns or sets a [[ChartFillBase]] derived object which defines the fill properties for the 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 formula(): Formula
  • The formula used to get the text displayed within the text area. (read-only). To set this property call the SetFormula method.

    See

    [[setFormula]]

    Returns Formula

  • get height(): number
  • Returns or sets a value that represents the height of the label, expressed as a ratio, relative to the size of the chart area.

    Returns number

  • set height(a): void
  • Parameters

    • a: number

    Returns void

  • get horizontalOverflow(): TextHorizontalOverflow
  • Determines whether text is allowed to continue horizontally outside the bounds of the containing element.

    Returns TextHorizontalOverflow

  • set horizontalOverflow(a): void
  • Parameters

    Returns void

  • get isDeleted(): boolean
  • Returns or sets a boolean value indicating whether this label has been deleted.

    Returns boolean

  • set isDeleted(a): void
  • Parameters

    • a: boolean

    Returns void

  • get labelPosition(): DataLabelPosition
  • Returns or sets a value which determines the label's position as relative to the series bar/line.

    When this property is set to Custom, the position is determined by the values of the Left and Top properties.

    When a custom label position is assigned, connecting lines appear between the label and its respective [[DataPoint]]. These lines are referred to as 'leader lines'; use the [[Series.leaderLines]] property to control their appearance.

    Note that leader lines can be hidden by setting the [[SeriesDataLabels.showLeaderLines]] property to false.

    See

    • [[ChartTextAreaBase.left]]
    • [[ChartTextAreaBase.top]]
    • [[Series.leaderLines]]
    • [[SeriesDataLabels.showLeaderLines]]

    Returns DataLabelPosition

  • set labelPosition(a): void
  • Parameters

    Returns void

  • get left(): number
  • The left position of the text area (ignored unless [[position]] is set to 'Custom').

    The value of this property is expressed as a fractional value between 0 and 1 which represents the ratio of the offset to the width of the chart element.

    For example, a value of 0 positions the text area as close as possible to the edge of the chart element; a value of 1 positions it as close as possible to the opposite edge. All values in between 0 and 1 represent a scalar which, when applied to the width of the entire chart element, yields the offset.

    See

    [[position]]

    Returns number

  • set left(a): void
  • Parameters

    • a: number

    Returns void

  • get numberFormat(): string
  • Returns or sets the format to use for numbers.

    See

    [[numberFormatLinked]]

    Returns string

  • set numberFormat(a): void
  • Parameters

    • a: string

    Returns void

  • get numberFormatLinked(): boolean
  • True if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).

    See

    [[numberFormat]]

    Returns boolean

  • set numberFormatLinked(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 parentLabelLayout(): ParentLabelLayout
  • Returns or sets a value which determines the label positioning for a Treemap chart.

    This property is only applicable for Treemap charts.

    Returns ParentLabelLayout

  • set parentLabelLayout(a): void
  • Parameters

    Returns void

  • get position(): ElementPosition
  • Determines whether the position of the text area is automatic or custom as specified by the [[left]] and [[top]] properties.

    Returns ElementPosition

  • set position(a): void
  • Parameters

    Returns void

  • get readingOrder(): ReadingOrder
  • Determines the reading order

    Returns ReadingOrder

  • set readingOrder(a): void
  • Parameters

    Returns void

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

    Returns number

  • set rotation(a): void
  • Parameters

    • a: number

    Returns void

  • get separator(): string
  • Returns or sets the separator used between multiple values in the label.

    Returns string

  • set separator(a): void
  • Parameters

    • a: string

    Returns void

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

    Returns Sheet

  • get showBubbleSize(): boolean
  • Returns or sets if the bubble size is shown. Applies only to [[Series]] which are displayed within a bubble chart.

    Returns boolean

  • set showBubbleSize(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showCategoryName(): boolean
  • Returns or sets a value indicating whether the category name is shown.

    The category name is not shown by default; to show the category name in the label, set this property to true.

    Returns boolean

  • set showCategoryName(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showLeaderLines(): boolean
  • Returns or sets a boolean value indicating whether leader lines are displayed for the data labels associated with this instance.

    Leader lines connect data labels to their respective data points.

    The [[LeaderLines]] property provides a way to customize the appearance of the connecting lines. These lines are only drawn, however, for data labels whose [[DataLabel.labelPosition]] property is set to Custom.

    Use this property to allow leader lines to be shown using the default appearance, i.e., setting this property to true without specifying a custom appearance causes them to acquire the default appearance as determined by Excel.

    Leader lines can be hidden by setting this property to false.

    See

    • [[Series.leaderLines]]
    • [[DataLabel]]
    • [[DataLabel.labelPosition]]
    • [[ChartTextAreaBase.left]]
    • [[ChartTextAreaBase.top]]
    • [[DataPoint]]

    Returns boolean

  • set showLeaderLines(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showLegendKey(): boolean
  • Returns or sets if the [[Legend]] key is shown.

    The legend key is not shown by default; to show the legend key in the label, set this property to true.

    Returns boolean

  • set showLegendKey(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showPercentage(): boolean
  • Returns or sets a value indicating whether the percentage of the range is shown.

    The percentage is not shown by default; to show the percentage in the label, set this property to true.

    Returns boolean

  • set showPercentage(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showRange(): boolean
  • Returns or sets a boolean value indicating whether the data label range is shown.

    The data label range is defined by the [[SeriesDataLabels.dataLabelsRange]]

    The data label range is not shown by default; to show the range in the label, set this property to true.

    See

    [[SeriesDataLabels.dataLabelsRange]]

    Returns boolean

  • set showRange(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showSeriesName(): boolean
  • Returns or sets a value indicating whether the series name is shown in the label.

    The series name is not shown by default; to show the series name in the label, set this property to true.

    Returns boolean

  • set showSeriesName(a): void
  • Parameters

    • a: boolean

    Returns void

  • get showValue(): boolean
  • Returns or sets a value indicating whether the value is shown.

    The value is shown by default; to prevent the value from displaying in the label, set this property to false.

    Returns boolean

  • set showValue(a): void
  • Parameters

    • a: boolean

    Returns void

  • get text(): FormattedString
  • Returns or sets a [[FormattedString]] object which defines the text to be displayed by the associated chart element.

    Because mixed font settings are supported for chart element text, a special object is required to customize the text.

    For the simple case where all the text has the same formatting, create an instance of the [[FormattedString]] class, specifiying the text as the value of the 'unformattedString' parameter.

    To apply font attributes to a given run of text, i.e., a substring within the text, use the [[FormattedString.getFont]] method, and set the applicable properties of the [[FormattedStringFont]] instance returned from the GetFont method.

    See

    • [[FormattedString..ctor]]
    • [[FormattedString.getFont]]

    Returns FormattedString

  • set text(a): void
  • Parameters

    Returns void

  • 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
  • The top position of the text area (ignored unless [[position]] is set to 'Custom').

    The value of this property is expressed as a fractional value between 0 and 1 which represents the ratio of the offset to the height of the associated chart element.

    For example, a value of 0 positions the title as close as possible to the edge of the associated chart element; a value of 1 positions it as close as possible to the opposite edge. All values in between 0 and 1 represent a scalar which, when applied to the height of the entire chart element, yields the offset.

    See

    [[position]]

    Returns number

  • set top(a): void
  • Parameters

    • a: number

    Returns void

  • get verticalAlignment(): VerticalTitleAlignment
  • Determines the vertical alignment of the text area.

    Returns VerticalTitleAlignment

  • set verticalAlignment(a): void
  • Parameters

    Returns void

  • get verticalOverflow(): TextVerticalOverflow
  • Determines whether text is allowed to continue vertically outside the bounds of the containing element.

    Returns TextVerticalOverflow

  • set verticalOverflow(a): void
  • Parameters

    Returns void

  • get width(): number
  • Returns or sets a value that represents the width of the label, expressed as a ratio, relative to the size of the chart area.

    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

  • get wrapText(): boolean
  • Determines whether text is wrapped when it would exceed the bounds of the containing element.

    Returns boolean

  • set wrapText(a): void
  • Parameters

    • a: boolean

    Returns void

Methods

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Returns Base

  • Assigns a [[Formula]] to the [[dataLabelsRange]]

    Parameters

    • formula: string

      The string representation of the formula used to obtain the data label text.

    • Optional cellReferenceMode: CellReferenceMode

      A [[CellReferenceMode]] value which specifies whether the 'formula' parameter should be interpreted as an A1 or R1C1 expression. This parameter is optional and defaults to null, in which case the [[Workbook.cellReferenceMode]] property is used.

    Returns void

  • Not supported.

    Parameters

    Returns void

  • 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

  • Returns void