BarDataLabel Class
Contains settings for a data label in a bar chart.
Declaration
public class BarDataLabel extends DataLabel
Remarks
The BarDataLabel class inherits label content and formatting settings from DataLabel and DataLabelBase classes (for example, BarDataLabel.setShowValue(value) and BarDataLabel.setCustomText(value) methods).
Call the setLabelPosition(BarDataLabelPosition value) method to specify the label position relative to the bar.
Pass a BarDataLabel object to the IBarDataLabels.setLabel(key, value) method to format the data label of an individual data point.
Refer to the following help topic for additional information: Customize Chart Data Labels — Presentation API for Java.
Inherited Members
Inheritance
BarDataLabel()
Initializes a new instance of the BarDataLabel class.
Declaration
public BarDataLabel()
Methods
deepClone() Method
Returns a deep copy of this BarDataLabel instance.
Declaration
public BarDataLabel deepClone()
Returns
| Type | Description |
|---|---|
BarDataLabel |
A deep copy of this |
getLabelPosition() Method
Returns the data label position relative to the bar.
Declaration
public BarDataLabelPosition getLabelPosition()
Returns
| Type | Description |
|---|---|
| BarDataLabelPosition | The data label position. |
setLabelPosition(BarDataLabelPosition value) Method
Sets the data label position relative to the bar.
Declaration
public 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 for a new data label and the value from the document for a loaded data label.