DataLabel Object
Excel Developer Reference |
Represents the data label on a chart point or trendline.
Remarks
On a series, the DataLabel object is a member of the DataLabels collection. The DataLabels collection contains a DataLabel object for each point. For a series without definable points (such as an area series), the DataLabels collection contains a single DataLabel object.
Example
Use DataLabels(
index
), where
index
is the data-label index number, to return a single DataLabel object. The following example sets the number format for the fifth data label in series one in embedded chart one on worksheet one.
Visual Basic for Applications |
---|
|
Use the DataLabel property to return the DataLabel object for a single point. The following example turns on the data label for the second point in series one on the chart sheet named "Chart1" and sets the data label text to "Saturday."
Visual Basic for Applications |
---|
|
On a trendline, the DataLabel property returns the text shown with the trendline. This can be the equation, the R-squared value, or both (if both are showing). The following example sets the trendline text to show only the equation and then places the data label text in cell A1 on the worksheet named "Sheet1."
Visual Basic for Applications |
---|
|
See Also