DataLabel Class
Contains settings for a data label in a standard chart.
Declaration
public abstract class DataLabel extends DataLabelBase
Remarks
DataLabel is the base class for data labels of individual data points in standard charts. The following classes derive from the DataLabel class:
- AreaDataLabel - area series.
- BarDataLabel - bar series.
- Bar3DDataLabel - 3D bar series.
- BubbleDataLabel - bubble series.
- DoughnutDataLabel - doughnut series.
- LineDataLabel - line series.
- Line3DDataLabel - 3D line series.
- PieDataLabel - pie series.
- RadarDataLabel - radar series.
- ScatterDataLabel - scatter series.
- StockDataLabel - stock series.
The DataLabel class inherits label content and formatting settings from the DataLabelBase class (for example, DataLabel.setShowValue(value) and DataLabel.setNumberFormat(value) methods).
setCustomText(TextArea value) and setTextReference(IChartDataReference value) methods replace label content with custom text or text from a chart data reference.
Refer to the following help topic for additional information: Customize Chart Data Labels — Presentation API for Java.
Inherited Members
Inheritance
DataLabel()
Initializes a new instance of the DataLabel class.
Declaration
public DataLabel()
Methods
deepClone() Method
Returns a deep copy of this DataLabel instance.
Declaration
public DataLabel deepClone()
Returns
| Type | Description |
|---|---|
DataLabel |
A deep copy of this |
getCustomText() Method
Returns custom text of the data label.
Declaration
public TextArea getCustomText()
Returns
| Type | Description |
|---|---|
| TextArea | Custom text of the data label. |
getLayout() Method
Returns layout settings for the data label.
Declaration
public LayoutOptions getLayout()
Returns
| Type | Description |
|---|---|
| LayoutOptions | Layout settings. |
getTextReference() Method
Returns a chart data reference to the data label text.
Declaration
public IChartDataReference getTextReference()
Returns
| Type | Description |
|---|---|
| IChartDataReference | A reference to the data label text. |
setCustomText(TextArea value) Method
Sets custom text of the data label.
Declaration
public void setCustomText(TextArea value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TextArea | Custom text of the data label. |
Remarks
If you pass a text area, the API clears the reference that the getTextReference() method returns.
setLayout(LayoutOptions value) Method
Sets layout settings for the data label.
Declaration
public void setLayout(LayoutOptions value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | LayoutOptions | Layout settings. |
setTextReference(IChartDataReference value) Method
Sets a chart data reference to the data label text.
Declaration
public void setTextReference(IChartDataReference value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | IChartDataReference | A reference to the data label text. |
Remarks
If you pass a reference, the API clears the custom text that the getCustomText() method returns.