IBarDataLabels Interface
Contains data label settings for a bar series or bar chart view.
Declaration
public interface IBarDataLabels extends IDataLabels
Remarks
Call the BarSeries.getDataLabels() method to access data label settings for a bar series. Call the BarChartView.getDataLabels() method to access data label settings for all series in a bar 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 BarDataLabel getLabel(int key)
Parameters
| Name | Type | Description |
|---|---|---|
| key | int | The zero-based index of the data point. |
Returns
| Type | Description |
|---|---|
| BarDataLabel | Data label settings, or |
getLabelPosition() Method
Returns the position of data labels relative to bars.
Declaration
public abstract BarDataLabelPosition getLabelPosition()
Returns
| Type | Description |
|---|---|
| BarDataLabelPosition | The data label position. |
setLabel(int key, BarDataLabel value) Method
Sets settings for the data label of the specified data point.
Declaration
public abstract void setLabel(int key, BarDataLabel value)
Parameters
| Name | Type | Description |
|---|---|---|
| key | int | The zero-based index of the data point. |
| value | BarDataLabel | Data label settings. |
Exceptions
| Type | Description |
|---|---|
| ArgumentNullException | Thrown if the |
Remarks
Pass a BarDataLabel 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 IBarDataLabels object.
setLabelPosition(BarDataLabelPosition value) Method
Sets the position of data labels relative to bars.
Declaration
public abstract void setLabelPosition(BarDataLabelPosition value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | BarDataLabelPosition | The data label position. |
Exceptions
| Type | Description |
|---|---|
| NullPointerException | Thrown if the |
Remarks
The setLabelPosition(value) method accepts the following values:
| Value | Description |
|---|---|
| CENTER | Indicates that the data label is in the center of the bar. |
| INSIDE_BASE | Indicates that the data label is inside the bar at the bar base. |
| INSIDE_END | Indicates that the data label is inside the bar at the bar end. |
| OUTSIDE_END | Indicates that the data label is outside the bar beyond the bar end. |
| 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 BarDataLabelPosition.DEFAULT.
Call the BarDataLabel.setLabelPosition(value) method to specify the position of an individual data label.