aspose.cells

Class DataLabels

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

Example:

//Set the DataLabels in the chart
 var datalabels;
 for (var i = 0; i < chart.getNSeries().getCount(); i++)
 {
     datalabels = chart.getNSeries().get(i).getDataLabels();
     //Set the position of DataLabels
     datalabels.setPosition(aspose.cells.LabelPositionType.INSIDE_BASE);
     //Show the category name in the DataLabels
     datalabels.setCategoryNameShown(true);
     //Show the value in the DataLabels
     datalabels.setValueShown(true);
     //Not show the percentage in the DataLabels
     datalabels.setPercentageShown(false);
     //Not show the legend key.
     datalabels.setLegendKeyShown(false);
 }

Property Getters/Setters Summary
functiongetArea()
Gets the area.
functiongetAutoScaleFont()
function
           True if the text in the object changes font size when the object size changes. The default value is True.
functiongetBackground()
function
           Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant.
functiongetBackgroundMode()
function
           Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant.
functiongetBorder()
Gets the Line.
functiongetChart()
functiongetDefaultHeight()
Represents height of default position
functiongetDefaultWidth()
Represents width of default position
functiongetDefaultX()
Represents x of default position
functiongetDefaultY()
Represents y of default position
functiongetFont()
Gets the font of the DataLabels;
functiongetHeight()
function
setHeight(value)
           Gets or sets the height of frame in units of 1/4000 of the chart area.
functionisAutomaticSize()
function
           Indicates whether the chart frame is automatic sized.
functionisAutoText()
function
           Indicates the text is auto generated.
functionisBubbleSizeShown()
function
           Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
functionisCategoryNameShown()
function
           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.
functionisDefaultPosBeSet()
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
functionisDeleted()
function
setDeleted(value)
           Indicates whether this data lables is deleted.
functionisInnerMode()
function
           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.
functionisLegendKeyShown()
function
           Represents a specified chart's data label legend key display behavior.True if the data label legend key is visible.
functionisPercentageShown()
function
           Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
functionisResizeShapeToFitText()
function
           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.
functionisSeriesNameShown()
function
           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.
functionisTextWrapped()
function
           Gets or sets a value indicating whether the text is wrapped.
functionisValueShown()
function
           Represents a specified chart's data label values display behavior. True displays the values. False to hide.
functiongetLinkedSource()
function
           Gets and sets a reference to the worksheet.
functiongetNumber()
function
setNumber(value)
           Gets ans sets the built-in _number format.
functiongetNumberFormat()
function
           Represents the format string for the DataLabels object.
functiongetNumberFormatLinked()
function
           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).
functiongetPosition()
function
           Represents the position of the data lable. The value of the property is LabelPositionType integer constant.
functiongetRotationAngle()
function
           Represents text rotation angle.
functiongetSeparator()
function
           Sets or returns the _separator type used for the data labels on a chart. The value of the property is DataLablesSeparatorType integer constant.
functiongetSeparatorValue()
function
           Sets or returns the _separator value used for the data labels on a chart.
functiongetShadow()
function
setShadow(value)
           True if the frame has a shadow.
functiongetShapeProperties()
Gets the ShapeProperties object.
functiongetShapeType()
function
           Gets or sets shape type of data label. The value of the property is DataLabelShapeType integer constant.
functiongetShowBubbleSize()
function
           Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
functiongetShowCategoryName()
function
           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.
functiongetShowCellRange()
function
           Indicates whether showing cell range as the data labels.
functiongetShowLegendKey()
function
           Represents a specified chart's data label legend key display behavior. True if the data label legend key is visible.
functiongetShowPercentage()
function
           Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
functiongetShowSeriesName()
function
           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.
functiongetShowValue()
function
           Represents a specified chart's data label values display behavior. True displays the values. False to hide.
functiongetText()
function
setText(value)
           Gets or sets the text of a frame's title.
functiongetTextDirection()
function
           Represents text reading order. The value of the property is TextDirectionType integer constant.
functiongetTextFont()
Gets a Font object of the specified ChartFrame object.
functiongetTextHorizontalAlignment()
function
           Ges or sets the text horizontal alignment. The value of the property is TextAlignmentType integer constant.
functiongetTextVerticalAlignment()
function
           Gets or sets the text vertical alignment of text. The value of the property is TextAlignmentType integer constant.
functiongetWidth()
function
setWidth(value)
           Gets or sets the width of frame in units of 1/4000 of the chart area.
functiongetX()
function
setX(value)
           Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
functiongetY()
function
setY(value)
           Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
 
Method Summary
functioncharacters(startIndex, length)
Returns a Characters object that represents a range of characters within the text.
functionsetPositionAuto()
Set position of the frame to automatic
 

    • Property Getters/Setters Detail

      • isAutoText/setAutoText : boolean 

        function isAutoText() / function setAutoText(value)
        
        Indicates the text is auto generated.
      • getText/setText : String 

        function getText() / function setText(value)
        
        Gets or sets the text of a frame's title.
      • isTextWrapped/setTextWrapped : boolean 

        function isTextWrapped() / function setTextWrapped(value)
        
        Gets or sets a value indicating whether the text is wrapped.
      • getBackgroundMode/setBackgroundMode : Number 

        function getBackgroundMode() / function setBackgroundMode(value)
        
        Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant.
      • isValueShown/setValueShown : boolean 

        function isValueShown() / function setValueShown(value)
        
        Represents a specified chart's data label values display behavior. True displays the values. False to hide. NOTE: This member is now obsolete. Instead, please use DataLabels.ShowValue property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • getShowValue/setShowValue : boolean 

        function getShowValue() / function setShowValue(value)
        
        Represents a specified chart's data label values display behavior. True displays the values. False to hide.
      • getShowCellRange/setShowCellRange : boolean 

        function getShowCellRange() / function setShowCellRange(value)
        
        Indicates whether showing cell range as the data labels.
      • isPercentageShown/setPercentageShown : boolean 

        function isPercentageShown() / function setPercentageShown(value)
        
        Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide. NOTE: This member is now obsolete. Instead, please use DataLabels.ShowPercentage property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • getShowPercentage/setShowPercentage : boolean 

        function getShowPercentage() / function setShowPercentage(value)
        
        Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
      • isBubbleSizeShown/setBubbleSizeShown : boolean 

        function isBubbleSizeShown() / function setBubbleSizeShown(value)
        
        Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide. NOTE: This member is now obsolete. Instead, please use DataLabels.ShowBubbleSize property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • getShowBubbleSize/setShowBubbleSize : boolean 

        function getShowBubbleSize() / function setShowBubbleSize(value)
        
        Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide.
      • getShowCategoryName/setShowCategoryName : boolean 

        function getShowCategoryName() / function setShowCategoryName(value)
        
        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.
      • isCategoryNameShown/setCategoryNameShown : boolean 

        function isCategoryNameShown() / function setCategoryNameShown(value)
        
        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. NOTE: This member is now obsolete. Instead, please use DataLabels.ShowCategoryName property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • isSeriesNameShown/setSeriesNameShown : boolean 

        function isSeriesNameShown() / function setSeriesNameShown(value)
        
        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. NOTE: This member is now obsolete. Instead, please use DataLabels.ShowSeriesName property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • getShowSeriesName/setShowSeriesName : boolean 

        function getShowSeriesName() / function setShowSeriesName(value)
        
        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.
      • isLegendKeyShown/setLegendKeyShown : boolean 

        function isLegendKeyShown() / function setLegendKeyShown(value)
        
        Represents a specified chart's data label legend key display behavior.True if the data label legend key is visible. NOTE: This member is now obsolete. Instead, please use DataLabels.ShowLegendKey property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • getShowLegendKey/setShowLegendKey : boolean 

        function getShowLegendKey() / function setShowLegendKey(value)
        
        Represents a specified chart's data label legend key display behavior. True if the data label legend key is visible.
      • getNumberFormat/setNumberFormat : String 

        function getNumberFormat() / function setNumberFormat(value)
        
        Represents the format string for the DataLabels object.
      • getNumber/setNumber : Number 

        function getNumber() / function setNumber(value)
        
        Gets ans sets the built-in _number format.
      • getNumberFormatLinked/setNumberFormatLinked : boolean 

        function getNumberFormatLinked() / function setNumberFormatLinked(value)
        
        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).
      • getFont : Font 

        function getFont()
        
        Gets the font of the DataLabels;
      • getSeparator/setSeparator : Number 

        function getSeparator() / function setSeparator(value)
        
        Sets or returns the _separator type used for the data labels on a chart. The value of the property is DataLablesSeparatorType integer constant. Sets _separator type will specify standard _separator for datalabels. Space is " " Comma is ", " Semicolon is "; " Period is ". " NewLine is "\n" If want set standard _separator, may sets _separator tyep to InnerCustom and set SepartorValue at the same time.
      • getSeparatorValue/setSeparatorValue : String 

        function getSeparatorValue() / function setSeparatorValue(value)
        
        Sets or returns the _separator value used for the data labels on a chart.
      • getPosition/setPosition : Number 

        function getPosition() / function setPosition(value)
        
        Represents the position of the data lable. The value of the property is LabelPositionType integer constant.
      • getShapeType/setShapeType : Number 

        function getShapeType() / function setShapeType(value)
        
        Gets or sets shape type of data label. The value of the property is DataLabelShapeType integer constant.
      • isDeleted/setDeleted : boolean 

        function isDeleted() / function setDeleted(value)
        
        Indicates whether this data lables is deleted.
      • getTextHorizontalAlignment/setTextHorizontalAlignment : Number 

        function getTextHorizontalAlignment() / function setTextHorizontalAlignment(value)
        
        Ges or sets the text horizontal alignment. The value of the property is TextAlignmentType integer constant.
      • getTextVerticalAlignment/setTextVerticalAlignment : Number 

        function getTextVerticalAlignment() / function setTextVerticalAlignment(value)
        
        Gets or sets the text vertical alignment of text. The value of the property is TextAlignmentType integer constant.
      • getRotationAngle/setRotationAngle : Number 

        function getRotationAngle() / function setRotationAngle(value)
        
        Represents text rotation angle.
        0: Not rotated.

        255: Top to Bottom.

        -90: Downward.

        90: Upward.
      • getLinkedSource/setLinkedSource : String 

        function getLinkedSource() / function setLinkedSource(value)
        
        Gets and sets a reference to the worksheet.
      • getTextDirection/setTextDirection : Number 

        function getTextDirection() / function setTextDirection(value)
        
        Represents text reading order. The value of the property is TextDirectionType integer constant.
      • isResizeShapeToFitText/setResizeShapeToFitText : boolean 

        function isResizeShapeToFitText() / function setResizeShapeToFitText(value)
        
        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.
      • isInnerMode/setInnerMode : boolean 

        function isInnerMode() / function setInnerMode(value)
        
        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. Only for Xlsx file.
      • getChart : Chart 

        function getChart()
        
      • getBorder : Line 

        function getBorder()
        
        Gets the Line.
      • getArea : Area 

        function getArea()
        
        Gets the area.
      • getTextFont : Font 

        function getTextFont()
        
        Gets a Font object of the specified ChartFrame object. NOTE: This member is now obsolete. Instead, please use ChartFrame.Font property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
      • getAutoScaleFont/setAutoScaleFont : boolean 

        function getAutoScaleFont() / function setAutoScaleFont(value)
        
        True if the text in the object changes font size when the object size changes. The default value is True.
      • getBackground/setBackground : Number 

        function getBackground() / function setBackground(value)
        
        Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant.NOTE: This member is now obsolete. Instead, please use ChartFrame.BackgroundMode property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
      • isAutomaticSize/setAutomaticSize : boolean 

        function isAutomaticSize() / function setAutomaticSize(value)
        
        Indicates whether the chart frame is automatic sized.
      • getX/setX : Number 

        function getX() / function setX(value)
        
        Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? X In Pixels = X * Chart.ChartObject.Width / 4000;
      • getY/setY : Number 

        function getY() / function setY(value)
        
        Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Y In Pixels = Y * Chart.ChartObject.Height / 4000;
      • getHeight/setHeight : Number 

        function getHeight() / function setHeight(value)
        
        Gets or sets the height of frame in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Height In Pixels = Y * Chart.ChartObject.Height / 4000;
      • getWidth/setWidth : Number 

        function getWidth() / function setWidth(value)
        
        Gets or sets the width of frame in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Width In Pixels = Width * Chart.ChartObject.Height / 4000;
      • getShadow/setShadow : boolean 

        function getShadow() / function setShadow(value)
        
        True if the frame has a shadow.
      • isDefaultPosBeSet : boolean 

        function isDefaultPosBeSet()
        
        Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
      • getDefaultX : Number 

        function getDefaultX()
        
        Represents x of default position
      • getDefaultY : Number 

        function getDefaultY()
        
        Represents y of default position
      • getDefaultWidth : Number 

        function getDefaultWidth()
        
        Represents width of default position
      • getDefaultHeight : Number 

        function getDefaultHeight()
        
        Represents height of default position
    • Method Detail

      • characters

        function characters(startIndex, length)
        Returns a Characters object that represents a range of characters within the text.
        Parameters:
        startIndex: Number - The index of the start of the character.
        length: Number - The number of characters.
        Returns:
        Characters object.
      • setPositionAuto

        function setPositionAuto()
        Set position of the frame to automatic