Edit

Share via


ExcelScript.ChartDataLabel interface

Represents the data label of a chart point.

Methods

getAutoText()

Specifies if the data label automatically generates appropriate text based on context.

getFormat()

Represents the format of chart data label.

getFormula()

String value that represents the formula of chart data label using A1-style notation.

getGeometricShapeType()

Specifies the geometric shape type of the data label. See ExcelScript.GeometricShapeType for more details. Value is null if the data label is not a geometric shape.

getHeight()

Returns the height, in points, of the chart data label. Value is null if the chart data label is not visible.

getHorizontalAlignment()

Represents the horizontal alignment for chart data label. See ExcelScript.ChartTextHorizontalAlignment for details. This property is valid only when TextOrientation of data label is -90, 90, or 180.

getLeft()

Represents the distance, in points, from the left edge of chart data label to the left edge of chart area. Value is null if the chart data label is not visible.

getLinkNumberFormat()

Specifies if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).

getNumberFormat()

String value that represents the format code for data label.

getPosition()

Value that represents the position of the data label. See ExcelScript.ChartDataLabelPosition for details.

getSeparator()

String representing the separator used for the data label on a chart.

getShowAsStickyCallout()

Gets a value that indicates whether the data labels are shown as a callout with the tail anchor attached to the data point. If true, the callout is one of the following values: "AccentCallout1", "AccentCallout2", "BorderCallout1", "BorderCallout2", "WedgeRectCallout", "WedgeRRectCallout" or "WedgeEllipseCallout". See Excel.GeometricShapeType for more details.

getShowBubbleSize()

Specifies if the data label bubble size is visible.

getShowCategoryName()

Specifies if the data label category name is visible.

getShowLegendKey()

Specifies if the data label legend key is visible.

getShowPercentage()

Specifies if the data label percentage is visible.

getShowSeriesName()

Specifies if the data label series name is visible.

getShowValue()

Specifies if the data label value is visible.

getSubstring(start, length)

Returns a substring of the data label. The line break character '\n' counts as one character.

getTailAnchor()

Returns the tail anchor of the data label which is shown as a sticky callout.

getText()

String representing the text of the data label on a chart.

getTextOrientation()

Represents the angle to which the text is oriented for the chart data label. The value should either be an integer from -90 to 90 or the integer 180 for vertically-oriented text.

getTop()

Represents the distance, in points, from the top edge of chart data label to the top of chart area. Value is null if the chart data label is not visible.

getVerticalAlignment()

Represents the vertical alignment of chart data label. See ExcelScript.ChartTextVerticalAlignment for details. This property is valid only when TextOrientation of data label is 0.

getWidth()

Returns the width, in points, of the chart data label. Value is null if the chart data label is not visible.

setAutoText(autoText)

Specifies if the data label automatically generates appropriate text based on context.

setFormula(formula)

String value that represents the formula of chart data label using A1-style notation.

setGeometricShapeType(geometricShapeType)

Specifies the geometric shape type of the data label. See ExcelScript.GeometricShapeType for more details. Value is null if the data label is not a geometric shape.

setHeight(height)

Sets the height of the data label in points.

setHorizontalAlignment(horizontalAlignment)

Represents the horizontal alignment for chart data label. See ExcelScript.ChartTextHorizontalAlignment for details. This property is valid only when TextOrientation of data label is -90, 90, or 180.

setLeft(left)

Represents the distance, in points, from the left edge of chart data label to the left edge of chart area. Value is null if the chart data label is not visible.

setLinkNumberFormat(linkNumberFormat)

Specifies if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).

setNumberFormat(numberFormat)

String value that represents the format code for data label.

setPosition(position)

Value that represents the position of the data label. See ExcelScript.ChartDataLabelPosition for details.

setSeparator(separator)

String representing the separator used for the data label on a chart.

setShowBubbleSize(showBubbleSize)

Specifies if the data label bubble size is visible.

setShowCategoryName(showCategoryName)

Specifies if the data label category name is visible.

setShowLegendKey(showLegendKey)

Specifies if the data label legend key is visible.

setShowPercentage(showPercentage)

Specifies if the data label percentage is visible.

setShowSeriesName(showSeriesName)

Specifies if the data label series name is visible.

setShowValue(showValue)

Specifies if the data label value is visible.

setText(text)

String representing the text of the data label on a chart.

setTextOrientation(textOrientation)

Represents the angle to which the text is oriented for the chart data label. The value should either be an integer from -90 to 90 or the integer 180 for vertically-oriented text.

setTop(top)

Represents the distance, in points, from the top edge of chart data label to the top of chart area. Value is null if the chart data label is not visible.

setVerticalAlignment(verticalAlignment)

Represents the vertical alignment of chart data label. See ExcelScript.ChartTextVerticalAlignment for details. This property is valid only when TextOrientation of data label is 0.

setWidth(width)

Sets the width of the data label in points.

Method Details

getAutoText()

Specifies if the data label automatically generates appropriate text based on context.

getAutoText(): boolean;

Returns

boolean

getFormat()

Represents the format of chart data label.

getFormat(): ChartDataLabelFormat;

Returns

getFormula()

String value that represents the formula of chart data label using A1-style notation.

getFormula(): string;

Returns

string

getGeometricShapeType()

Specifies the geometric shape type of the data label. See ExcelScript.GeometricShapeType for more details. Value is null if the data label is not a geometric shape.

getGeometricShapeType(): GeometricShapeType;

Returns

getHeight()

Returns the height, in points, of the chart data label. Value is null if the chart data label is not visible.

getHeight(): number;

Returns

number

getHorizontalAlignment()

Represents the horizontal alignment for chart data label. See ExcelScript.ChartTextHorizontalAlignment for details. This property is valid only when TextOrientation of data label is -90, 90, or 180.

getHorizontalAlignment(): ChartTextHorizontalAlignment;

Returns

getLeft()

Represents the distance, in points, from the left edge of chart data label to the left edge of chart area. Value is null if the chart data label is not visible.

getLeft(): number;

Returns

number

getLinkNumberFormat()

Specifies if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).

getLinkNumberFormat(): boolean;

Returns

boolean

getNumberFormat()

String value that represents the format code for data label.

getNumberFormat(): string;

Returns

string

getPosition()

Value that represents the position of the data label. See ExcelScript.ChartDataLabelPosition for details.

getPosition(): ChartDataLabelPosition;

Returns

getSeparator()

String representing the separator used for the data label on a chart.

getSeparator(): string;

Returns

string

getShowAsStickyCallout()

Gets a value that indicates whether the data labels are shown as a callout with the tail anchor attached to the data point. If true, the callout is one of the following values: "AccentCallout1", "AccentCallout2", "BorderCallout1", "BorderCallout2", "WedgeRectCallout", "WedgeRRectCallout" or "WedgeEllipseCallout". See Excel.GeometricShapeType for more details.

getShowAsStickyCallout(): boolean;

Returns

boolean

getShowBubbleSize()

Specifies if the data label bubble size is visible.

getShowBubbleSize(): boolean;

Returns

boolean

getShowCategoryName()

Specifies if the data label category name is visible.

getShowCategoryName(): boolean;

Returns

boolean

getShowLegendKey()

Specifies if the data label legend key is visible.

getShowLegendKey(): boolean;

Returns

boolean

getShowPercentage()

Specifies if the data label percentage is visible.

getShowPercentage(): boolean;

Returns

boolean

getShowSeriesName()

Specifies if the data label series name is visible.

getShowSeriesName(): boolean;

Returns

boolean

getShowValue()

Specifies if the data label value is visible.

getShowValue(): boolean;

Returns

boolean

getSubstring(start, length)

Returns a substring of the data label. The line break character '\n' counts as one character.

getSubstring(start: number, length?: number): ChartFormatString;

Parameters

start

number

The zero-based starting character position of a substring in the data label.

length

number

Optional. The number of characters in the substring. If length is omitted, all the characters from start to the end of the data label are retrieved.

Returns

getTailAnchor()

Returns the tail anchor of the data label which is shown as a sticky callout.

getTailAnchor(): ChartDataLabelAnchor;

Returns

getText()

String representing the text of the data label on a chart.

getText(): string;

Returns

string

getTextOrientation()

Represents the angle to which the text is oriented for the chart data label. The value should either be an integer from -90 to 90 or the integer 180 for vertically-oriented text.

getTextOrientation(): number;

Returns

number

getTop()

Represents the distance, in points, from the top edge of chart data label to the top of chart area. Value is null if the chart data label is not visible.

getTop(): number;

Returns

number

getVerticalAlignment()

Represents the vertical alignment of chart data label. See ExcelScript.ChartTextVerticalAlignment for details. This property is valid only when TextOrientation of data label is 0.

getVerticalAlignment(): ChartTextVerticalAlignment;

Returns

getWidth()

Returns the width, in points, of the chart data label. Value is null if the chart data label is not visible.

getWidth(): number;

Returns

number

setAutoText(autoText)

Specifies if the data label automatically generates appropriate text based on context.

setAutoText(autoText: boolean): void;

Parameters

autoText

boolean

Returns

void

setFormula(formula)

String value that represents the formula of chart data label using A1-style notation.

setFormula(formula: string): void;

Parameters

formula

string

Returns

void

setGeometricShapeType(geometricShapeType)

Specifies the geometric shape type of the data label. See ExcelScript.GeometricShapeType for more details. Value is null if the data label is not a geometric shape.

setGeometricShapeType(geometricShapeType: GeometricShapeType): void;

Parameters

geometricShapeType
ExcelScript.GeometricShapeType

Returns

void

setHeight(height)

Sets the height of the data label in points.

setHeight(height: number): void;

Parameters

height

number

The height of the data label in points.

Returns

void

setHorizontalAlignment(horizontalAlignment)

Represents the horizontal alignment for chart data label. See ExcelScript.ChartTextHorizontalAlignment for details. This property is valid only when TextOrientation of data label is -90, 90, or 180.

setHorizontalAlignment(
            horizontalAlignment: ChartTextHorizontalAlignment
        ): void;

Parameters

Returns

void

setLeft(left)

Represents the distance, in points, from the left edge of chart data label to the left edge of chart area. Value is null if the chart data label is not visible.

setLeft(left: number): void;

Parameters

left

number

Returns

void

setLinkNumberFormat(linkNumberFormat)

Specifies if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).

setLinkNumberFormat(linkNumberFormat: boolean): void;

Parameters

linkNumberFormat

boolean

Returns

void

setNumberFormat(numberFormat)

String value that represents the format code for data label.

setNumberFormat(numberFormat: string): void;

Parameters

numberFormat

string

Returns

void

setPosition(position)

Value that represents the position of the data label. See ExcelScript.ChartDataLabelPosition for details.

setPosition(position: ChartDataLabelPosition): void;

Parameters

Returns

void

setSeparator(separator)

String representing the separator used for the data label on a chart.

setSeparator(separator: string): void;

Parameters

separator

string

Returns

void

setShowBubbleSize(showBubbleSize)

Specifies if the data label bubble size is visible.

setShowBubbleSize(showBubbleSize: boolean): void;

Parameters

showBubbleSize

boolean

Returns

void

setShowCategoryName(showCategoryName)

Specifies if the data label category name is visible.

setShowCategoryName(showCategoryName: boolean): void;

Parameters

showCategoryName

boolean

Returns

void

setShowLegendKey(showLegendKey)

Specifies if the data label legend key is visible.

setShowLegendKey(showLegendKey: boolean): void;

Parameters

showLegendKey

boolean

Returns

void

setShowPercentage(showPercentage)

Specifies if the data label percentage is visible.

setShowPercentage(showPercentage: boolean): void;

Parameters

showPercentage

boolean

Returns

void

setShowSeriesName(showSeriesName)

Specifies if the data label series name is visible.

setShowSeriesName(showSeriesName: boolean): void;

Parameters

showSeriesName

boolean

Returns

void

setShowValue(showValue)

Specifies if the data label value is visible.

setShowValue(showValue: boolean): void;

Parameters

showValue

boolean

Returns

void

setText(text)

String representing the text of the data label on a chart.

setText(text: string): void;

Parameters

text

string

Returns

void

setTextOrientation(textOrientation)

Represents the angle to which the text is oriented for the chart data label. The value should either be an integer from -90 to 90 or the integer 180 for vertically-oriented text.

setTextOrientation(textOrientation: number): void;

Parameters

textOrientation

number

Returns

void

setTop(top)

Represents the distance, in points, from the top edge of chart data label to the top of chart area. Value is null if the chart data label is not visible.

setTop(top: number): void;

Parameters

top

number

Returns

void

setVerticalAlignment(verticalAlignment)

Represents the vertical alignment of chart data label. See ExcelScript.ChartTextVerticalAlignment for details. This property is valid only when TextOrientation of data label is 0.

setVerticalAlignment(
            verticalAlignment: ChartTextVerticalAlignment
        ): void;

Parameters

Returns

void

setWidth(width)

Sets the width of the data label in points.

setWidth(width: number): void;

Parameters

width

number

The width of the data label in points.

Returns

void