DataLabels Class

Encapsulates a collection of all the DataLabel objects for the specified Series.
Inheritance Hierarchy

Namespace:  Aspose.Cells.Charts
Assembly:  Aspose.Cells (in Aspose.Cells.dll) Version: 20.10.0.0 (20.10)
Syntax
public class DataLabels : ChartTextFrame

The DataLabels type exposes the following members.

Properties
  NameDescription
Public propertyArea
Gets the area.
(Overrides ChartFrameArea.)
Public propertyAutoScaleFont
True if the text in the object changes font size when the object size changes. The default value is True.
(Inherited from ChartFrame.)
Public propertyBackground Obsolete.
Gets and sets the display mode of the background
(Inherited from ChartFrame.)
Public propertyBackgroundMode
Gets and sets the display mode of the background
Public propertyBorder
Gets the border.
(Overrides ChartFrameBorder.)
Public propertyDefaultHeight
Represents height of default position
(Inherited from ChartFrame.)
Public propertyDefaultWidth
Represents width of default position
(Inherited from ChartFrame.)
Public propertyDefaultX
Represents x of default position
(Inherited from ChartFrame.)
Public propertyDefaultY
Represents y of default position
(Inherited from ChartFrame.)
Public propertyDirectionType
Gets and sets the direction of text.
(Overrides ChartTextFrameDirectionType.)
Public propertyFont
Gets the font of the DataLabels;
(Overrides ChartFrameFont.)
Public propertyHeight
Gets or sets the height of frame in units of 1/4000 of the chart area.
(Inherited from ChartFrame.)
Public propertyIsAutomaticSize
Indicates whether the chart frame is automatic sized.
(Inherited from ChartFrame.)
Public propertyIsAutoText
Indicates the text is auto generated.
(Overrides ChartTextFrameIsAutoText.)
Public propertyIsDefaultPosBeSet
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
(Inherited from ChartFrame.)
Public propertyIsDeleted
Indicates whether this data labels is deleted.
(Inherited from ChartTextFrame.)
Public propertyIsInnerMode
Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels.
(Inherited from ChartFrame.)
Public propertyIsResizeShapeToFitText
Gets or sets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside.
(Inherited from ChartTextFrame.)
Public propertyIsTextWrapped
Gets or sets a value indicating whether the text is wrapped.
(Overrides ChartTextFrameIsTextWrapped.)
Public propertyLinkedSource
Gets and sets the linked source.
(Overrides ChartTextFrameLinkedSource.)
Public propertyNumber
Gets and sets the built-in number format.
Public propertyNumberFormat
Represents the format string for the DataLabels object.
Public propertyNumberFormatLinked
True if the number format is linked to the cells (so that the number format changes in the labels when it changes in the cells).
Public propertyPosition
Represents the position of the data label.
Public propertyReadingOrder
Represents text reading order.
(Inherited from ChartTextFrame.)
Public propertyRotationAngle
Represents text rotation angle.
(Inherited from ChartTextFrame.)
Public propertySeparator Obsolete.
Gets or sets the separator type used for the data labels on a chart.
Public propertySeparatorType
Gets or sets the separator type used for the data labels on a chart.
Public propertySeparatorValue
Gets or sets the separator value used for the data labels on a chart.
Public propertyShadow
True if the frame has a shadow.
(Inherited from ChartFrame.)
Public propertyShapeProperties
Gets the ShapeProperties object.
(Inherited from ChartFrame.)
Public propertyShapeType
Gets or sets shape type of data label.
Public propertyShowBubbleSize
Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
Public propertyShowCategoryName
Represents a specified chart's data label category name display behavior.True to display the category name for the data labels on a chart. False to hide.
Public propertyShowCellRange
Indicates whether showing cell range as the data labels.
Public propertyShowLegendKey
Represents a specified chart's data label legend key display behavior. True if the data label legend key is visible.
Public propertyShowPercentage
Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
Public propertyShowSeriesName
Returns or sets a Boolean to indicate the series name display behavior for the data labels on a chart. True to show the series name. False to hide.
Public propertyShowValue
Represents a specified chart's data label values display behavior. True displays the values. False to hide.
Public propertyText
Gets or sets the text of data label.
(Overrides ChartTextFrameText.)
Public propertyTextDirection Obsolete.
Represents text reading order.
(Inherited from ChartTextFrame.)
Public propertyTextFont Obsolete.
Gets a Font object of the specified ChartFrame object.
(Inherited from ChartFrame.)
Public propertyTextHorizontalAlignment
Gets and sets the text horizontal alignment.
(Inherited from ChartTextFrame.)
Public propertyTextVerticalAlignment
Gets or sets the text vertical alignment of text.
(Inherited from ChartTextFrame.)
Public propertyWidth
Gets or sets the width of frame in units of 1/4000 of the chart area.
(Inherited from ChartFrame.)
Public propertyX
Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
(Inherited from ChartFrame.)
Public propertyY
Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
(Inherited from ChartFrame.)
Methods
  NameDescription
Public methodCharacters
Returns a Characters object that represents a range of characters within the text.
(Inherited from ChartTextFrame.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodSetPositionAuto
Set position of the frame to automatic
(Inherited from ChartFrame.)
Public methodToString (Inherited from Object.)
Fields
  NameDescription
Protected fieldhorizontal (Inherited from ChartTextFrame.)
Protected fieldm_AutoScaleFont (Inherited from ChartFrame.)
Protected fieldm_BackgroundMode (Inherited from ChartFrame.)
Protected fieldm_CharsList (Inherited from ChartTextFrame.)
Protected fieldm_deleted (Inherited from ChartTextFrame.)
Protected fieldm_font (Inherited from ChartFrame.)
Protected fieldm_fontIndex (Inherited from ChartFrame.)
Protected fieldm_isAutoSize (Inherited from ChartFrame.)
Protected fieldm_IsAutoText (Inherited from ChartTextFrame.)
Protected fieldm_IsAutoXPos (Inherited from ChartFrame.)
Protected fieldm_IsAutoYPos (Inherited from ChartFrame.)
Protected fieldrotation (Inherited from ChartTextFrame.)
Protected fieldvertical (Inherited from ChartTextFrame.)
Examples
[C#]

//Set the DataLabels in the chart
DataLabels datalabels;
for (int i = 0; i  <chart.NSeries.Count; i++)
{
    datalabels = chart.NSeries[i].DataLabels;
    //Set the position of DataLabels
    datalabels.Position = LabelPositionType.InsideBase;
    //Show the category name in the DataLabels
    datalabels.ShowCategoryName = true;
    //Show the value in the DataLabels
    datalabels.ShowValue = true;
    //Not show the percentage in the DataLabels
    datalabels.ShowPercentage = false;
    //Not show the legend key.
    datalabels.ShowLegendKey = false;
}

[Visual Basic]

'Set the DataLabels in the chart
Dim datalabels As DataLabels
Dim i As Integer
For i = 0 To chart.NSeries.Count - 1 Step 1
    datalabels = chart.NSeries(i).DataLabels
    'Set the position of DataLabels
    datalabels.Position = LabelPositionType.InsideBase
    'Show the category name in the DataLabels
    datalabels.ShowCategoryName= True
    'Show the value in the DataLabels
    datalabels.ShowValue = True
    'Not show the percentage in the DataLabels
    datalabels.ShowPercentage = False
    'Not show the legend key.
    datalabels.ShowLegendKey = False
Next
See Also