Skip to main content

IDataLabelBase Interface

The base interface for common data label settings in standard charts.

Declaration

public interface IDataLabelBase

Remarks

The IDataLabels interface extends the IDataLabelBase interface. Call the getDataLabels() method of a series or chart view (for example, LineSeries.getDataLabels() or LineChartView.getDataLabels()) to access data label settings. The settings apply to data labels of all data points in the series or chart view.

A data label can display the data point value, the category name, the series name, the legend key, and text from a cell range. The following methods specify data label content:

To format the data label of an individual data point, call the setLabel(key, value) method of the object that the getDataLabels() method returns (for example, ILineDataLabels.setLabel(key, value)).

Refer to the following help topic for additional information: Customize Chart Data Labels — Presentation API for Java.

Methods

getHidden() Method

Returns whether data labels are hidden.

Declaration

public abstract boolean getHidden()

Returns

Type Description
boolean

true if data labels are hidden; otherwise, false.

getNumberFormat() Method

Returns number format settings for numeric values in data labels.

Declaration

public abstract NumberFormatOptions getNumberFormat()

Returns

Type Description
NumberFormatOptions

Number format settings.

getProperties() Method

Returns fill, outline, and shape effect settings for data labels.

Declaration

public abstract ChartElement getProperties()

Returns

Type Description
ChartElement

Fill, outline, and shape effect settings.

getSeparator() Method

Returns the separator between parts of data label text.

Declaration

public abstract String getSeparator()

Returns

Type Description
String

The separator string.

getShowCategoryName() Method

Returns whether data labels display category names.

Declaration

public abstract boolean getShowCategoryName()

Returns

Type Description
boolean

true if data labels display category names; otherwise, false.

getShowDataLabelRange() Method

Returns whether data labels display text from a cell range.

Declaration

public abstract boolean getShowDataLabelRange()

Returns

Type Description
boolean

true if data labels display text from a cell range; otherwise, false.

getShowLegendKey() Method

Returns whether data labels display legend keys.

Declaration

public abstract boolean getShowLegendKey()

Returns

Type Description
boolean

true if data labels display legend keys; otherwise, false.

getShowSeriesText() Method

Returns whether data labels display the series name.

Declaration

public abstract boolean getShowSeriesText()

Returns

Type Description
boolean

true if data labels display the series name; otherwise, false.

getShowValue() Method

Returns whether data labels display data point values.

Declaration

public abstract boolean getShowValue()

Returns

Type Description
boolean

true if data labels display data point values; otherwise, false.

getTextProperties() Method

Returns text formatting settings for data labels.

Declaration

public abstract TextProperties getTextProperties()

Returns

Type Description
TextProperties

Text formatting settings.

setHidden(boolean value) Method

Sets whether to hide data labels.

Declaration

public abstract void setHidden(boolean value)

Parameters

Name Type Description
value boolean

true to hide data labels; otherwise, false.

setNumberFormat(NumberFormatOptions value) Method

Sets number format settings for numeric values in data labels.

Declaration

public abstract void setNumberFormat(NumberFormatOptions value)

Parameters

Name Type Description
value NumberFormatOptions

Number format settings.

setProperties(ChartElement value) Method

Sets fill, outline, and shape effect settings for data labels.

Declaration

public abstract void setProperties(ChartElement value)

Parameters

Name Type Description
value ChartElement

Fill, outline, and shape effect settings.

setSeparator(String value) Method

Sets the separator between parts of data label text.

Declaration

public abstract void setSeparator(String value)

Parameters

Name Type Description
value String

The separator string.

Remarks

If you call the setSeparator(null) method, the API uses a comma followed by a space as the separator. For a new series, the getSeparator() method returns null.

setShowCategoryName(boolean value) Method

Sets whether to display category names in data labels.

Declaration

public abstract void setShowCategoryName(boolean value)

Parameters

Name Type Description
value boolean

true to display category names; otherwise, false.

setShowDataLabelRange(boolean value) Method

Sets whether to display text from a cell range in data labels.

Declaration

public abstract void setShowDataLabelRange(boolean value)

Parameters

Name Type Description
value boolean

true to display text from a cell range; otherwise, false.

Remarks

If the series is in a chart and you pass a cell range to the setDataLabelsRange(value) method of the series (for example, LineSeries.setDataLabelsRange(value)), the getShowDataLabelRange() method returns true. If you call the setDataLabelsRange(null) method, the getShowDataLabelRange() method returns false.

setShowLegendKey(boolean value) Method

Sets whether to display legend keys in data labels.

Declaration

public abstract void setShowLegendKey(boolean value)

Parameters

Name Type Description
value boolean

true to display legend keys; otherwise, false.

setShowSeriesText(boolean value) Method

Sets whether to display the series name in data labels.

Declaration

public abstract void setShowSeriesText(boolean value)

Parameters

Name Type Description
value boolean

true to display the series name; otherwise, false.

setShowValue(boolean value) Method

Sets whether to display data point values in data labels.

Declaration

public abstract void setShowValue(boolean value)

Parameters

Name Type Description
value boolean

true to display data point values; otherwise, false.

setTextProperties(TextProperties value) Method

Sets text formatting settings for data labels.

Declaration

public abstract void setTextProperties(TextProperties value)

Parameters

Name Type Description
value TextProperties

Text formatting settings.