Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class Axis

java.lang.Object
  extended by com.aspose.cells.Axis
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
CategoryAxis, SeriesAxis, ValueAxis

public class Axis
extends java.lang.Object
implements java.lang.Cloneable

Encapsulates the object that represents a chart's axis.


Method Summary
 Area getArea()
          Gets the area of Axis for fill formatting.
 Line getAxisLine()
          Gets the appearance of an axis.
 byte getBackgroundMode()
          Gets the display mode of the background.
 DisplayUnitLabel getDisplayUnitLabel()
          Get the unit label on an axis.
 byte getDisplayUnitType()
          Get the unit label type for the specified axis.
 Font getFont()
          Gets a Font object that represents the font of the specified TickLabels object.
 Line getMajorGridLines()
          Gets major gridlines on a chart axis.
 int getMajorTickMark()
          Gets the type of major tick mark for the axis.
 Line getMinorGridLines()
          Gets minor gridlines on a chart axis.
 int getMinorTickMark()
          Gets the type of minor tick mark for the axis.
 int getNumber()
          Gets the format index for the TickLabels object.
 java.lang.String getNumberFormat()
          Gets the format string for the TickLabels object.
 int getRotation()
          Gets text rotation angle.
 int getTextDirection()
          Gets the text direction type.
 int getTickLabelPosition()
          Gets the position of tick-mark labels on the axis.
 boolean isAutoScaleFont()
          Check whether the text in the object changes font size when the object size changes.
 boolean isDisplayUnitLabelShown()
          If the display unit label is shown on the specified axis.
 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 isVisible()
          Indicates whether the axis is visible.
 void setAutoScaleFont(boolean isAutoScaleFont)
          Set whether the text in the object changes font size when the object size changes.
 void setAxisLine(Line line)
          Sets the appearance of an axis.
 void setBackgroundMode(byte mode)
          Sets the display mode of the background.
 void setDisplayUnitLabelShown(boolean isShown)
          Sets whether the display unit label is shown on the specified axis
 void setDisplayUnitType(byte displayUnitType)
          Set the unit label for the specified axis.
 void setFont(Font font)
          Sets a Font object that represents the font of the specified TickLabels object.
 void setMajorTickMark(int majorTickMark)
          Sets the type of major tick mark for the axis.
 void setMinorTickMark(int minorTickMark)
          Sets the type of minor tick mark for the axis.
 void setNumber(int number)
          Sets the format index for the TickLabels object.
 void setNumberFormat(java.lang.String format)
          Sets the format string for the TickLabels 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 setRotation(int rotation)
          Sets text rotation angle.Must be between -90 and 90.
 void setTextDirection(int directionType)
          Sets the text direction type.
 void setTickLabelPosition(int tickLabelPosition)
          Sets the position of tick-mark labels on the axis.
 void setVisible(boolean isVisible)
          Sets whether the axis is visible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDisplayUnitLabel

public DisplayUnitLabel getDisplayUnitLabel()
Get the unit label on an axis. Unit labels are useful for charting large values�for example, in the millions or billions.

Returns:
unit label on an axis

getDisplayUnitType

public byte getDisplayUnitType()
Get the unit label type for the specified axis.

Returns:
unit label type

setDisplayUnitType

public void setDisplayUnitType(byte displayUnitType)
Set the unit label for the specified axis.

Parameters:
displayUnitType - It must be one of the following values:
DisplayUnitType.NONE
DisplayUnitType.HUNDREDS
DisplayUnitType.THOUSANDS
DisplayUnitType.MILLIONS
DisplayUnitType.BILLIONS
DisplayUnitType.TRILLIONS

isDisplayUnitLabelShown

public boolean isDisplayUnitLabelShown()
If the display unit label is shown on the specified axis.

Returns:
true if the display unit label is shown on the specified axis.

setDisplayUnitLabelShown

public void setDisplayUnitLabelShown(boolean isShown)
Sets whether the display unit label is shown on the specified axis

Parameters:
isShown - if the display unit label is shown on the specified axis

getAxisLine

public Line getAxisLine()
Gets the appearance of an axis.

Returns:
the appearance of an axis.
Throws:
CellsException - if chart has bean removed.

setAxisLine

public void setAxisLine(Line line)
Sets the appearance of an axis.

Parameters:
line - the appearance of an axis.
Throws:
CellsException - if chart has bean removed.

getArea

public Area getArea()
Gets the area of Axis for fill formatting.

Returns:
the area of Axis.

getMajorGridLines

public Line getMajorGridLines()
Gets major gridlines on a chart axis.

Returns:
major gridlines on a chart axis.
Throws:
CellsException - if chart has bean removed.

getMinorGridLines

public Line getMinorGridLines()
Gets minor gridlines on a chart axis.

Returns:
minor gridlines on a chart axis.
Throws:
CellsException - if chart has bean removed.

getFont

public Font getFont()
Gets a Font object that represents the font of the specified TickLabels object.

Returns:
a Font object.
Throws:
CellsException - if chart has bean removed.

setFont

public void setFont(Font font)
Sets a Font object that represents the font of the specified TickLabels object.

Parameters:
font - a Font object.
Throws:
CellsException - if chart 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

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

getNumber

public int getNumber()
Gets the format index for the TickLabels object.

Returns:
the format index
Throws:
CellsException - if chart has bean removed.
See Also:
Style.setNumber(int)

setNumber

public void setNumber(int number)
Sets the format index for the TickLabels object.

Parameters:
number - the format index.
Throws:
CellsException - if chart 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 TickLabels object.

Returns:
the format string for the TickLabels object.

setNumberFormat

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

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

getRotation

public int getRotation()
Gets text rotation angle.

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

setRotation

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

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

getMajorTickMark

public int getMajorTickMark()
Gets the type of major tick mark for the axis.

Returns:
the type of major tick mark for the axis.
Throws:
CellsException - if chart has bean removed.
See Also:
setMajorTickMark(int)

setMajorTickMark

public void setMajorTickMark(int majorTickMark)
Sets the type of major tick mark for the axis.

Parameters:
majorTickMark - the type of major tick mark for the axis. It could be one of the following values:
TickMarkerType.CROSS
TickMarkerType.INSIDE
TickMarkerType.NONE
TickMarkerType.OUTSIDE
Throws:
java.lang.IllegalArgumentException - if majorTickMark is invalid tick mark type.
CellsException - if chart has bean removed.

getMinorTickMark

public int getMinorTickMark()
Gets the type of minor tick mark for the axis.

Returns:
the type of minor tick mark for the axis.
Throws:
CellsException - if chart has bean removed.
See Also:
setMajorTickMark(int)

setMinorTickMark

public void setMinorTickMark(int minorTickMark)
Sets the type of minor tick mark for the axis.

Parameters:
minorTickMark - the type of minor tick mark for the axis.
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if minorTickMark is invalid tick mark type.
See Also:
setMajorTickMark(int)

getTickLabelPosition

public int getTickLabelPosition()
Gets the position of tick-mark labels on the axis.

Returns:
the position of tick-mark labels on the axis.
Throws:
CellsException - if chart has bean removed.
See Also:
setTickLabelPosition(int)

setTickLabelPosition

public void setTickLabelPosition(int tickLabelPosition)
Sets the position of tick-mark labels on the axis.

Parameters:
tickLabelPosition - the position of tick-mark labels on the axis. * It could be one of the following values:
TickLabelPositionType.HIGH
TickLabelPositionType.LOW
TickLabelPositionType.NEXT_TO_AXIS
TickLabelPositionType.NONE
Throws:
java.lang.IllegalArgumentException - if tick label position type is invalid.
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

isVisible

public boolean isVisible()
Indicates whether the axis is visible.

Returns:
whether the axis is visible.
Throws:
CellsException - if chart has bean removed.

setVisible

public void setVisible(boolean isVisible)
Sets whether the axis is visible.

Parameters:
isVisible - whether the axis is visible.
Throws:
CellsException - if chart has bean removed.