IDataLabelCollection
All Implemented Interfaces: com.aspose.ms.System.Collections.Generic.IGenericEnumerable, com.aspose.slides.IChartComponent
public interface IDataLabelCollection extends System.Collections.Generic.IGenericEnumerable<IDataLabel>, IChartComponent
Represents a series labels.
Methods
Method | Description |
---|---|
get_Item(int index) | Gets the data label for the data point with the specified index. |
getDefaultDataLabelFormat() | Returns default format of all data labels in the collection. |
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. |
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. |
getParentSeries() | Returns parent chart series. |
indexOf(IDataLabel value) | Returns an index of the specified DataLabel in the collection. |
get_Item(int index)
public abstract IDataLabel get_Item(int index)
Gets the data label for the data point with the specified index.
Alternate way to access data label is: - getSeries().getDataPoints().get_Item(i).getLabel() - manage label properties.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int |
Returns: IDataLabel
getDefaultDataLabelFormat()
public abstract IDataLabelFormat getDefaultDataLabelFormat()
Returns default format of all data labels in the collection. Read-only IDataLabelFormat.
Returns: IDataLabelFormat
getLeaderLinesFormat()
public abstract 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 abstract 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 abstract 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 |
isVisible()
public abstract 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 abstract 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 abstract int getCountOfVisibleDataLabels()
Gets the number of visible data labels in the collection. Read-only int .
Returns: int
getCount()
public abstract int getCount()
Gets the number of all data labels in the collection. Read-only int .
Returns: int
getParentSeries()
public abstract IChartSeries getParentSeries()
Returns parent chart series. Read-only IChartSeries.
Returns: IChartSeries
indexOf(IDataLabel value)
public abstract 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.