Skip to main content

IStockDataLabels Interface

Contains data label settings for a stock series or stock chart view.

Declaration

public interface IStockDataLabels extends IDataLabels

Remarks

Call the StockSeries.getDataLabels() method to access data label settings for a stock series. Call the StockChartView.getDataLabels() method to access data label settings for all series in a stock chart view.

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

Implements

Methods

getLabel(int key) Method

Returns settings for the data label of the specified data point.

Declaration

public abstract StockDataLabel getLabel(int key)

Parameters

Name Type Description
key int

The zero-based index of the data point.

Returns

Type Description
StockDataLabel

Data label settings, or null if the data point has no individual data label settings.

getLabelPosition() Method

Returns the position of data labels relative to data points.

Declaration

public abstract StockDataLabelPosition getLabelPosition()

Returns

Type Description
StockDataLabelPosition

The data label position.

setLabel(int key, StockDataLabel value) Method

Sets settings for the data label of the specified data point.

Declaration

public abstract void setLabel(int key, StockDataLabel value)

Parameters

Name Type Description
key int

The zero-based index of the data point.

value StockDataLabel

Data label settings.

Exceptions

Type Description
ArgumentNullException

Thrown if the value parameter is null and the series or chart view is in a presentation.

Remarks

Pass a StockDataLabel object to the setLabel(key, value) method to format the data label of an individual data point.

To remove individual data label settings, call the remove(key) method of the IStockDataLabels object.

setLabelPosition(StockDataLabelPosition value) Method

Sets the position of data labels relative to data points.

Declaration

public abstract void setLabelPosition(StockDataLabelPosition value)

Parameters

Name Type Description
value StockDataLabelPosition

The data label position.

Exceptions

Type Description
NullPointerException

Thrown if the value parameter is null.

Remarks

The setLabelPosition(value) method accepts the following values:

Value Description
LEFT Indicates that the data label is to the left of the data point.
TOP Indicates that the data label is above the data point.
RIGHT Indicates that the data label is to the right of the data point.
BOTTOM Indicates that the data label is below the data point.
CENTER Indicates that the data label is centered on the data point.
DEFAULT Indicates that the data label position is not specified, and the chart application uses the default position.

If you do not call the setLabelPosition(value) method, the API uses StockDataLabelPosition.DEFAULT.

Call the StockDataLabel.setLabelPosition(value) method to specify the position of an individual data label.