Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class DataLabels

java.lang.Object
  extended by com.aspose.cells.ChartFrame
      extended by com.aspose.cells.DataLabels

public class DataLabels
extends ChartFrame

DataLabels of specified ASeries, ChartPoint or Trendline.


Method Summary
 boolean equals(java.lang.Object another)
           
 byte getBackgroundMode()
          Gets the display mode of the background.
 Font getFont()
          Gets a Font object of the chart data label.
 byte getLabelPosition()
          Gets the lable position.
 int getNumber()
          Gets the built-in display format of numbers and dates.
 java.lang.String getNumberFormat()
          Gets the format string for the DataLabels object.
 int getRotation()
          Gets text rotation angel.
 char getSeparator()
          Get the separator used for the data labels on a chart.
 java.lang.String getText()
          Sets the text of a frame's title.
 int getTextDirection()
          Gets the text direction type.
 int getTextHorizontalAlignment()
          Gets the text horizontal alignment.
 int getTextVerticalAlignment()
          Gets the text vertical alignment of text.
 int getX()
          Gets position of DataLabels.
 int getY()
          Gets position of DataLabels.
 boolean isAutoScaleFont()
          Check whether the text in the object changes font size when the object size changes.
 boolean isBubbleShown()
          Indicates whether the chart's data label bubble size display.
 boolean isCategoryNameShown()
          Indicates whether the chart's data label category name display.
 boolean isLegendKeyShown()
          Indicates whether the chart's data label legend key display.
 boolean isNumberFormatLinked()
          Indicates if the number format is linked to the cells(so that the number format changes in the labels when it changes in the cells).
 boolean isPercentageShown()
          Indicates whether the chart's data label Percentage display.
 boolean isSeriesShown()
          Indicates whether chart's data label series names display.
 boolean isShadow()
          Indicates if the frame has a shadow.
 boolean isValueShown()
          Indicates whether the chart's data label values display.
 void setAutoScaleFont(boolean isAutoScaleFont)
          Set whether the text in the object changes font size when the object size changes.
 void setBackgroundMode(byte mode)
          Sets the display mode of the background.
 void setBubbleShown(boolean isBubbleShown)
          Sets whether the chart's data label bubble size display.
 void setCategoryNameShown(boolean isCategoryNameShown)
          Sets whether the chart's data label category name display.
 void setFont(Font font)
          Sets a Font object of the chart data label.
 void setLabelPosition(byte LablePositionType)
          Sets the label postion.
 void setLegendKeyShown(boolean isLegendKeyShown)
          Sets whether the chart's data label legend key display.
 void setNumber(int number)
          Sets the built-in display format of numbers and dates.
Use built-in numbers for better performance.
 void setNumberFormat(java.lang.String format)
          Sets the format string for the DataLabels object.
 void setNumberFormatLinked(boolean linked)
          Sets if the number format is linked to the cells(so that the number format changes in the labels when it changes in the cells).
 void setPercentageShown(boolean isPercentageShown)
          Sets whether the chart's data label Percentage display.
 void setRotation(int rotation)
          Sets text rotation angel.Must be between -90 and 90.
 void setSeparator(char separator)
          Set the separator used for the data labels on a chart.
 void setSeriesShown(boolean isSeriesShown)
          Sets whether chart's data label series names display.
 void setShadow(boolean shadow)
          Sets if the frame has a shadow.
 void setText(java.lang.String content)
          Gets the text of a frame's title.
 void setTextDirection(int directionType)
          Sets the text direction type.
 void setTextHorizontalAlignment(int textAlignmentType)
          Sets the text horizontal alignment.
 void setTextVerticalAlignment(int textAlignmentType)
          Sets the text vertical alignment of text.
 void setValueShown(boolean isValueShown)
          Sets whether the chart's data label values display.
 void setX(int x)
          Sets position of DataLabels.
 void setY(int y)
          Sets position of DataLabels.
 
Methods inherited from class com.aspose.cells.ChartFrame
getArea, getAreaOrNull, getBorder, getBorderOrNull
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public boolean equals(java.lang.Object another)
Overrides:
equals in class ChartFrame

getText

public java.lang.String getText()
Sets the text of a frame's title.

Returns:
the text of a frame's title.
Throws:
CellsException - if chart has bean removed.

setText

public void setText(java.lang.String content)
Gets the text of a frame's title.

Parameters:
content - the text of a frame's title.
Throws:
CellsException - if chart has bean removed.

setSeriesShown

public void setSeriesShown(boolean isSeriesShown)
Sets whether chart's data label series names display.

Parameters:
isSeriesShown - whether chart's data label series names display.
Throws:
CellsException - if the series has bean removed.

isSeriesShown

public boolean isSeriesShown()
Indicates whether chart's data label series names display. True if the data label series name is visible.

Returns:
whether chart's data label series names display.
Throws:
CellsException - if the series has bean removed.

setValueShown

public void setValueShown(boolean isValueShown)
Sets whether the chart's data label values display. True displays the values. False to hide.

Parameters:
isValueShown - whether the chart's data label values display.
Throws:
CellsException - if the series has bean removed.

isValueShown

public boolean isValueShown()
Indicates whether the chart's data label values display. True displays the values. False to hide.

Returns:
whether the chart's data label values display.
Throws:
CellsException - if the series has bean removed.

setCategoryNameShown

public void setCategoryNameShown(boolean isCategoryNameShown)
Sets whether the chart's data label category name display. True to display the category name for the data labels on a chart. False to hide.

Parameters:
isCategoryNameShown - whether the chart's data label category name display.
Throws:
CellsException - if the series has bean removed.

isCategoryNameShown

public boolean isCategoryNameShown()
Indicates whether the chart's data label category name display. True to display the category name for the data labels on a chart. False to hide.

Returns:
whether the chart's data label category name display.
Throws:
CellsException - if the series has bean removed.

isPercentageShown

public boolean isPercentageShown()
Indicates whether the chart's data label Percentage display. True to display the Percentage for the data labels on a chart. False to hide.

Returns:
whether the chart's data label Percentage display.
Throws:
CellsException - if the series has bean removed.

setPercentageShown

public void setPercentageShown(boolean isPercentageShown)
Sets whether the chart's data label Percentage display. True to display the Percentage for the data labels on a chart. False to hide.

Parameters:
isPercentageShown - whether the chart's data label Percentage display.
Throws:
CellsException - if the series has bean removed.

isBubbleShown

public boolean isBubbleShown()
Indicates whether the chart's data label bubble size display. True to display the bubble size for the data labels on a chart. False to hide.

Returns:
whether the chart's data label Percentage display.
Throws:
CellsException - if the series has bean removed.

setBubbleShown

public void setBubbleShown(boolean isBubbleShown)
Sets whether the chart's data label bubble size display. True to display the bubble size for the data labels on a chart. False to hide.

Parameters:
isBubbleShown - whether the chart's data label Percentage display.
Throws:
CellsException - if the series has bean removed.

isLegendKeyShown

public boolean isLegendKeyShown()
Indicates whether the chart's data label legend key display. True to display legend key for the data labels on a chart. False to hide.

Returns:
whether the chart's data label legend key display.
Throws:
CellsException - if the series has bean removed.

setLegendKeyShown

public void setLegendKeyShown(boolean isLegendKeyShown)
Sets whether the chart's data label legend key display. True to display legend key for the data labels on a chart. False to hide.

Parameters:
isLegendKeyShown - whether the chart's data label legend key display.
Throws:
CellsException - if the series has bean removed.

getLabelPosition

public byte getLabelPosition()
Gets the lable position.

Returns:
the lable position.

setLabelPosition

public void setLabelPosition(byte LablePositionType)
Sets the label postion.

Parameters:
LablePositionType - the label postion. It must be the const number of LabelPositionType.
See Also:
LabelPositionType

getSeparator

public char getSeparator()
Get the separator used for the data labels on a chart.

Returns:
the separator used for the data labels on a chart.

setSeparator

public void setSeparator(char separator)
Set the separator used for the data labels on a chart.

Parameters:
separator - valid separators defined in DataLabelsSeparatorType

isShadow

public boolean isShadow()
Indicates if the frame has a shadow.

Returns:
true if the frame has a shadow.

setShadow

public void setShadow(boolean shadow)
Sets if the frame has a shadow.

Parameters:
shadow - true if the frame has a shadow.

getBackgroundMode

public byte getBackgroundMode()
Gets the display mode of the background.

Returns:
the display mode of the background.
See Also:
setBackgroundMode(byte)

setBackgroundMode

public void setBackgroundMode(byte mode)
Sets the display mode of the background.

Parameters:
mode - the display mode of the background. It could be one of following:
BackgroundMode.AUTOMATIC
BackgroundMode.TRANSPARENT
BackgroundMode.OPAQUE

setNumber

public void setNumber(int number)
Sets the built-in display format of numbers and dates.
Use built-in numbers for better performance.

Parameters:
number - the built-in formatting number.
Throws:
java.lang.IllegalArgumentException - if number is invalid.
CellsException - if the series has bean removed.
See Also:
Style.setNumber(int)

getNumber

public int getNumber()
Gets the built-in display format of numbers and dates.

Returns:
the built-in formatting number.
Throws:
CellsException - if the series has bean removed.
See Also:
Style.setNumber(int)

isNumberFormatLinked

public boolean isNumberFormatLinked()
Indicates if the number format is linked to the cells(so that the number format changes in the labels when it changes in the cells).

Returns:
if the number format is linked to the cells

setNumberFormatLinked

public void setNumberFormatLinked(boolean linked)
Sets if the number format is linked to the cells(so that the number format changes in the labels when it changes in the cells).

Parameters:
linked - if the number format is linked to the cells

getNumberFormat

public java.lang.String getNumberFormat()
Gets the format string for the DataLabels object.

Returns:
the format string for the DataLabels object.

setNumberFormat

public void setNumberFormat(java.lang.String format)
Sets the format string for the DataLabels object.

Parameters:
format - the format string for the DataLabels object.

getFont

public Font getFont()
Gets a Font object of the chart data label.

Returns:
a Font object of the chart data label.
Throws:
CellsException - if series has bean removed.

setFont

public void setFont(Font font)
Sets a Font object of the chart data label.

Parameters:
font - a Font object of the chart data label.
Throws:
CellsException - if series has bean removed.

isAutoScaleFont

public boolean isAutoScaleFont()
Check whether the text in the object changes font size when the object size changes.

Returns:
whether the text in the object changes font size when the object size changes.

setAutoScaleFont

public void setAutoScaleFont(boolean isAutoScaleFont)
Set whether the text in the object changes font size when the object size changes.

Parameters:
isAutoScaleFont - whether the text in the object changes font size when the object size changes.

getTextHorizontalAlignment

public int getTextHorizontalAlignment()
Gets the text horizontal alignment.

Returns:
the text horizontal alignment.
Throws:
CellsException - if chart has bean removed.
See Also:
setTextHorizontalAlignment(int)

setTextHorizontalAlignment

public void setTextHorizontalAlignment(int textAlignmentType)
Sets the text horizontal alignment.

Parameters:
textAlignmentType - the text horizontal alignment. It could be one of the following values:
TextAlignmentType.LEFT
TextAlignmentType.CENTER
TextAlignmentType.RIGHT
TextAlignmentType.JUSTIFY
TextAlignmentType.DISTRIBUTED
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if test alignment type is invalid.

getTextVerticalAlignment

public int getTextVerticalAlignment()
Gets the text vertical alignment of text.

Returns:
the text vertical alignment of text.
Throws:
CellsException - if chart has bean removed.
See Also:
setTextVerticalAlignment(int)

setTextVerticalAlignment

public void setTextVerticalAlignment(int textAlignmentType)
Sets the text vertical alignment of text.

Parameters:
textAlignmentType - the text vertical alignment of text. * It could be one of the following values:
TextAlignmentType.TOP
TextAlignmentType.CENTER
TextAlignmentType.BOTTOM
TextAlignmentType.JUSTIFY
TextAlignmentType.DISTRIBUTED
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if test alignment type is invalid.

getRotation

public int getRotation()
Gets text rotation angel.

Returns:
text rotation angel.
Throws:
CellsException - if chart has bean removed.

setRotation

public void setRotation(int rotation)
Sets text rotation angel.Must be between -90 and 90.

Parameters:
rotation - text rotation angel.
Throws:
java.lang.IllegalArgumentException - if rotation is not between -90 and 90.
CellsException - if chart has bean removed.

getTextDirection

public int getTextDirection()
Gets the text direction type.

Returns:
the text direction type.
See Also:
TextDirectionType

setTextDirection

public void setTextDirection(int directionType)
Sets the text direction type.

Parameters:
directionType - the direction type. * It must be one of the following values:
TextDirectionType.CONTEXT
TextDirectionType.LEFT_TO_RIGHT
TextDirectionType.RIGHT_TO_LEFT
Throws:
java.lang.IllegalArgumentException - if the direction type is invalid.
See Also:
TextDirectionType

getX

public int getX()
Gets position of DataLabels.

Returns:
position of DataLabels.
See Also:
setX(int)

setX

public void setX(int x)
Sets position of DataLabels.

Parameters:
x - According to Chart type:
  • Pie charts: offset angle from the default, in degrees.
  • Bar and Column charts: offset perpendicular to the bar or column, in units of 1/1000 of the plot area.
  • All other chart types: horizontal offset from the default position, in units of 1/1000 of the plot area.

getY

public int getY()
Gets position of DataLabels.

Returns:
position of DataLabels.
See Also:
setY(int)

setY

public void setY(int y)
Sets position of DataLabels.

Parameters:
y - According to Chart type:
  • Pie charts: radial offset, in units of 1/1000 of the pie radius.
  • Bar and Column charts: offset parallel to the bar or column, in units of 1/1000 of the plot area.
  • All other chart types: vertical offset from the default position, in units of 1/1000 of the plot area.