public final class ChartDataLabels extends Object
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes data labels.
|
DataLabelPosition |
getLabelPosition()
Gets the position of the data label.
|
String |
getNumberFormat()
Gets the number format used for formatting data labels.
|
String |
getSeparator()
Gets the text that should be used to separate the parts of a data label.
|
boolean |
isLabelContainsCategoryName()
Gets a value indicating whether the category name should be shown in a data label.
|
boolean |
isLabelContainsLegendKey()
Gets a value indicating whether the legend key should be shown in a data label.
|
boolean |
isLabelContainsSeriesName()
Gets a value indicating whether the series name should be shown in a data label.
|
boolean |
isLabelContainsValue()
Gets a value indicating whether the value should be shown in a data label.
|
boolean |
isNumberFormatLinkedToSource()
Gets a value indicating whether number format from chart's source data (cells) will be used to format data labels.
|
boolean |
isShowLeaderLines()
Gets a value indicating whether leader lines should be shown for data labels.
|
void |
setLabelContainsCategoryName(boolean labelContainsCategoryName)
Sets a value indicating whether the category name should be shown in a data label.
|
void |
setLabelContainsLegendKey(boolean labelContainsLegendKey)
Sets a value indicating whether the legend key should be shown in a data label.
|
void |
setLabelContainsSeriesName(boolean labelContainsSeriesName)
Gets a value indicating whether the series name should be shown in a data label.
|
void |
setLabelContainsValue(boolean labelContainsValue)
Gets a value indicating whether the value should be shown in a data label.
|
void |
setLabelPosition(DataLabelPosition labelPosition)
Sets the position of the data label.
|
void |
setNumberFormat(String numberFormat)
Sets the number format used for formatting data labels.
|
void |
setNumberFormatLinkedToSource(boolean numberFormatLinkedToSource)
Sets a value indicating whether number format from chart's source data (cells) will be used to format data labels.
|
void |
setSeparator(String separator)
Sets the text that should be used to separate the parts of a data label.
|
void |
setShowLeaderLines(boolean showLeaderLines)
Sets a value indicating whether leader lines should be shown for data labels.
|
void |
show()
Shows the value in the data label.
|
void |
show(DataLabelPosition labelPosition)
Shows the value in the data label at the specified position.
|
String |
toString()
Returns a
String that represents this ChartDataLabels instance. |
public void delete()
public DataLabelPosition getLabelPosition()
public String getNumberFormat()
isNumberFormatLinkedToSource()
is true
, then number format from chart's source data (cells) will be used to format data labels.public String getSeparator()
public boolean isLabelContainsCategoryName()
true
if the category name should be shown in a data label; otherwise, false
.public boolean isLabelContainsLegendKey()
true
if the legend key should be shown in a data label; otherwise, false
.public boolean isLabelContainsSeriesName()
true
if the series name should be shown in a data label; otherwise, false
.public boolean isLabelContainsValue()
true
if the value should be shown in a data label; otherwise, false
.public boolean isNumberFormatLinkedToSource()
Default value of this field is true
.
true
if number format from chart's source data (cells) will be used to format data labels; otherwise, false
.public boolean isShowLeaderLines()
true
if leader lines should be shown for data labels; otherwise, false
.public void setLabelContainsCategoryName(boolean labelContainsCategoryName)
labelContainsCategoryName
- true
if the category name should be shown in a data label; otherwise, false
.public void setLabelContainsLegendKey(boolean labelContainsLegendKey)
labelContainsLegendKey
- true
if the legend key should be shown in a data label; otherwise, false
.public void setLabelContainsSeriesName(boolean labelContainsSeriesName)
labelContainsSeriesName
- true
if the series name should be shown in a data label; otherwise, false
.public void setLabelContainsValue(boolean labelContainsValue)
labelContainsValue
- true
if the value should be shown in a data label; otherwise, false
.public void setLabelPosition(DataLabelPosition labelPosition)
labelPosition
- The position of the data label.public void setNumberFormat(String numberFormat)
isNumberFormatLinkedToSource()
is true
, then number format from chart's source data (cells) will be used to format data labels.
Setting this field, sets setNumberFormatLinkedToSource(boolean)
to false
.numberFormat
- The number format used for formatting data labels.public void setNumberFormatLinkedToSource(boolean numberFormatLinkedToSource)
Default value of this field is true
.
numberFormatLinkedToSource
- true
if number format from chart's source data (cells) will be used to format data labels; otherwise, false
.public void setSeparator(String separator)
separator
- The text that should be used to separate the parts of a data label.public void setShowLeaderLines(boolean showLeaderLines)
showLeaderLines
- true
if leader lines should be shown for data labels; otherwise, false
.public void show()
public void show(DataLabelPosition labelPosition)
Shows the value in the data label at the specified position.
ColumnChart
and BarChart
support DataLabelPosition.CENTER
, DataLabelPosition.INSIDE_END
, DataLabelPosition.INSIDE_BASE
and DataLabelPosition.OUTSIDE_END
data label positions.
LineChart
supports DataLabelPosition.CENTER
, DataLabelPosition.LEFT
, DataLabelPosition.RIGHT
, DataLabelPosition.TOP
and DataLabelPosition.BOTTOM
data label positions.
PieChart
supports DataLabelPosition.CENTER
, DataLabelPosition.INSIDE_END
, DataLabelPosition.OUTSIDE_END
and DataLabelPosition.BEST_FIT
data label positions.
AreaChart
supports none of the data label positions. Use show()
overload for AreaChart
instead.
labelPosition
- The position of the label.UnsupportedOperationException
- The specified labelPosition
is not supported for this chart.public String toString()
String
that represents this ChartDataLabels
instance.
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
toString
in class Object
String
that represents this ChartDataLabels
instance.© GemBox d.o.o. — All rights reserved.