DataLabelCollection
Inheritance: java.lang.Object, com.aspose.slides.DomObject
All Implemented Interfaces: com.aspose.slides.IDataLabelCollection
public class DataLabelCollection extends DomObject<ChartSeries> implements IDataLabelCollection
Represents a series labels.
Methods
Method | Description |
---|---|
getChart() | Returns the parent chart. |
iterator() | Returns an enumerator that iterates through the collection. |
iteratorJava() | Returns a java iterator for the entire collection. |
isVisible() | False means that data label is not visible by default (and so all Show*-flags (ShowValue, …) of the DefaultDataLabelFormat property are false). |
hide() | Make data label hidden by default by setting all Show*-flags (ShowValue, …) of the DefaultDataLabelFormat property to false state. |
getCountOfVisibleDataLabels() | Gets the number of visible data labels in the collection. |
getCount() | Gets the number of all data labels in the collection. |
getDefaultDataLabelFormat() | Gets the default data label format. |
getLeaderLinesFormat() | Represents data labels leader lines format. |
getLeaderLinesColor() | Gets or sets the color of all leader lines in the collection. |
setLeaderLinesColor(Color value) | Gets or sets the color of all leader lines in the collection. |
getParentSeries() | Gets the parent series. |
indexOf(IDataLabel value) | Returns an index of the specified DataLabel in the collection. |
get_Item(int index) | Gets the data label for the data point with the specified index. |
getSlide() | Returns the parent slide of a FillFormat. |
getPresentation() | Returns the parent presentation of a FillFormat. |
getChart()
public final IChart getChart()
Returns the parent chart. Read-only IChart.
Returns: IChart
iterator()
public final System.Collections.Generic.IGenericEnumerator<IDataLabel> iterator()
Returns an enumerator that iterates through the collection.
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.slides.IDataLabel> - A IGenericEnumerator that can be used to iterate through the collection.
iteratorJava()
public final System.Collections.Generic.IGenericEnumerator<IDataLabel> iteratorJava()
Returns a java iterator for the entire collection.
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.slides.IDataLabel> - An java.util.Iterator for the entire collection.
isVisible()
public final boolean isVisible()
False means that data label is not visible by default (and so all Show*-flags (ShowValue, …) of the DefaultDataLabelFormat property are false). Read-only boolean.
If data label is visible by default you can make it hidden by default with Hide() method. But if data label is not visible by default (IsVisible is false) you can make data label “visible by default” with setting Show*-flags (ShowValue, …) of the DefaultDataLabelFormat property to true state.
Returns: boolean
hide()
public final void hide()
Make data label hidden by default by setting all Show*-flags (ShowValue, …) of the DefaultDataLabelFormat property to false state. IsVisible will be false after this.
If data label is not visible by default (IsVisible is false) you can make data label “visible by default” with setting Show*-flags (ShowValue, …) of the DefaultDataLabelFormat property to true state.
getCountOfVisibleDataLabels()
public final int getCountOfVisibleDataLabels()
Gets the number of visible data labels in the collection. Read-only int.
Returns: int
getCount()
public final int getCount()
Gets the number of all data labels in the collection. Read-only int.
Returns: int
getDefaultDataLabelFormat()
public final IDataLabelFormat getDefaultDataLabelFormat()
Gets the default data label format. Read-only IDataLabelFormat.
Returns: IDataLabelFormat
getLeaderLinesFormat()
public final IChartLinesFormat getLeaderLinesFormat()
Represents data labels leader lines format. Read-only IChartLinesFormat.
Example: Presentation pres = new Presentation("pres.pptx"); try { IChart chart = (IChart) pres.getSlides().get_Item(0).getShapes().get_Item(0); IChartSeriesCollection series = chart.getChartData().getSeries(); IDataLabelCollection labels = series.get_Item(0).getLabels(); labels.getLeaderLinesFormat().getLine().getFillFormat().setFillType(FillType.Solid); labels.getLeaderLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(new java.awt.Color(255, 0, 0, 255)); } finally { if (pres != null) pres.dispose(); }
Returns: IChartLinesFormat
getLeaderLinesColor()
public final Color getLeaderLinesColor()
Gets or sets the color of all leader lines in the collection. Read/write java.awt.Color.
Example: Presentation pres = new Presentation("pres.pptx"); try { IChart chart = (IChart) pres.getSlides().get_Item(0).getShapes().get_Item(0); IChartSeriesCollection series = chart.getChartData().getSeries(); IDataLabelCollection labels = series.get_Item(0).getLabels(); labels.setLeaderLinesColor(new java.awt.Color(255, 0, 0)); } finally { if (pres != null) pres.dispose(); }
Returns: java.awt.Color
setLeaderLinesColor(Color value)
public final void setLeaderLinesColor(Color value)
Gets or sets the color of all leader lines in the collection. Read/write java.awt.Color.
Example: Presentation pres = new Presentation("pres.pptx"); try { IChart chart = (IChart) pres.getSlides().get_Item(0).getShapes().get_Item(0); IChartSeriesCollection series = chart.getChartData().getSeries(); IDataLabelCollection labels = series.get_Item(0).getLabels(); labels.setLeaderLinesColor(new java.awt.Color(255, 0, 0)); } finally { if (pres != null) pres.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.awt.Color |
getParentSeries()
public final IChartSeries getParentSeries()
Gets the parent series. Read-only IChartSeries.
Returns: IChartSeries
indexOf(IDataLabel value)
public final int indexOf(IDataLabel value)
Returns an index of the specified DataLabel in the collection.
Parameters:
Parameter | Type | Description |
---|---|---|
value | IDataLabel | DataLabel to find. |
Returns: int - Index of a DataLabel or -1 if DataLabel not from this collection.
get_Item(int index)
public final IDataLabel get_Item(int index)
Gets the data label for the data point with the specified index.
Alternate way to access data label is: - series.getDataPoints().get_Item(i).getLabel() - manage label properties.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int |
Returns: IDataLabel
getSlide()
public final IBaseSlide getSlide()
Returns the parent slide of a FillFormat. Read-only BaseSlide.
Returns: IBaseSlide
getPresentation()
public final IPresentation getPresentation()
Returns the parent presentation of a FillFormat. Read-only IPresentation.
Returns: IPresentation