Summ:  Nested Fields Constr. Methods    Details:  Fields Constr. Methods      Class:  Constants Prev Next
com.artfulbits.aiCharts.Base
Class ChartAxis

java.lang.Object com.artfulbits.aiCharts.Base.ChartAxis

Declaration: public class ChartAxis extends Object

 

Represents chart axis element. Instantiated either ChartArea or manually for customizations purposes. Axis may be rendered in different ways depending on current CoordinateSystem that corresponds to chart type represented by series.
Generally, axis consists of four visual elements: grid, main axis line, labels ticks and title.

 

Since: 1.0
See also: ChartArea.ChartArea(String,ChartAxis,ChartAxis)ChartArea.getDefaultXAxis()ChartArea.getDefaultYAxis()ChartSeries.getActualXAxis()ChartSeries.getActualYAxis()

 

 

Nested Members Summary
static class ChartAxis.Label
    
Represents axis label.

 

 

Fields Summary
static int LABEL_CENTER
    
Labels are centered to axis line.
static int LABEL_INSIDE
    
Labels are rendered inside the axis line.
static int LABEL_OUTSIDE
    
Labels are rendered outside of axis line.
static int MODE_NO_LABELS
    
Indicates that labels for axis will not be calculated at all.
static int MODE_RANGE_LABELS
    
Indicates that labels for axis are automatically calculated with respect to its range and interval.
static int MODE_SERIES_LABELS
    
Indicates that labels for axis are automatically calculated for each point's X value on corresponding ChartSeries.
static int POSITION_BOTTOM
    
Axis is positioned to the bottom of parent ChartArea.
static int POSITION_HCENTER
    
Axis is positioned horizontally to the center of parent ChartArea.
static int POSITION_LEFT
    
Axis is positioned to the left side of parent ChartArea.
static int POSITION_RIGHT
    
Axis is positioned at the right side of parent ChartArea.
static int POSITION_TOP
    
Axis is positioned at the top of parent ChartArea.
static int POSITION_VCENTER
    
Axis is positioned vertically to the center of parent ChartArea.
static int TICK_CROSS
    
Tick mark starts from label and crosses axis line.
static int TICK_INNER
    
Tick mark starts from axis line.
static int TICK_NONE
    
No tick mark is present.
static int TICK_OUTER
    
Tick mark starts from label.
static int TYPE_DATE
    
X values of corresponding points collection are considered to be java.util.Date values.
static int TYPE_NUMBER
    
X values of corresponding points collection are considered to be java.lang.Double values.

 

 

Constructors Summary
ChartAxis(int position)
    
Initializes the new instance of ChartAxis.

 

 

Methods Summary
XYRect getBounds()
    
Gets the rectangular area occupied by axis.
ChartCollection getCustomLabels()
    
Get the collection of strip lines.
Format getFormat()
    
Gets the Format instance used to format labels.
int getGridColor()
    
Gets grid lines color.
boolean getGridVisible()
    
Gets the value indicating whether axis grid is visible.
int getLabelAlignment()
    
Gets labels alignment
int getLabelColor()
    
Gets axis labels color.
int getLabelPosition()
    
Gets value indicating how labels should be positioned on axis line.
int getLabelsMode()
    
Gets value representing logic that is used to calculate labels for axis.
int getLineColor()
    
Gets axis line color.
double getOrigin()
    
Gets the origin value for axis.
int getPadding()
    
Gets the padding value for axis.
int getPosition()
    
Gets the axis position.
ChartAxisScale getScale()
    
Gets instance of ChartAxisScale object that is in change of axis range calculations.
boolean getShowLabels()
    
Gets value identifying whether labels should be shown for this axis.
int getSpacing()
    
Gets value indicating distance between axis elements.
ChartCollection getStripLines()
    
Get the strip lines collection.
int getTickMode()
    
Gets mode for the tick marks.
int getTickSize()
    
Gets tick marks size.
java.lang.String getTitle()
    
Gets the string representation of axis' title.
int getValueType()
    
Gets the type of value that is used to represent axis labels.
void setFormat(Format format)
    
Sets the Format instance to use for the labels format.
void setGridColor(int color)
    
Sets grid lines color.
void setGridVisible(boolean value)
    
Sets the value indicating whether area grid is visible.
void setLabelAlignment(int align)
    
Sets labels alignment
void setLabelColor(int color)
    
Sets axis labels color.
void setLabelPosition(int position)
    
Sets value indicating how labels should be positioned on axis line.
void setLabelsMode(int mode)
    
Sets value representing logic that should be used to calculate labels for axis.
void setLineColor(int color)
    
Sets axis line color.
void setOrigin(double origin)
    
Sets the origin value for axis.
void setPadding(int padding)
    
Sets the padding value for axis.
void setPosition(int position)
    
Sets the axis position.
void setShowLabels(boolean showLabels)
    
Sets value determining whether labels should be drawn for this axis.
void setSpacing(int spacing)
    
Sets value indicating distance between axis elements.
void setTickMode(int mode)
    
Sets mode for the tick marks.
void setTickSize(int size)
    
Sets tick marks size.
void setTitle(java.lang.String title)
    
Sets the title for axis.
void setValueType(int valueType)
    
Sets the type of value that is used to represent axis labels.

 

Methods inherited from class: java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

 

 

 

POSITION_LEFT

 

public static final int POSITION_LEFT

 

Axis is positioned to the left side of parent ChartArea.

 

Since: 1.0
See also: Constants

 

 

 

POSITION_RIGHT

 

public static final int POSITION_RIGHT

 

Axis is positioned at the right side of parent ChartArea.

 

Since: 1.0
See also: Constants

 

 

 

POSITION_TOP

 

public static final int POSITION_TOP

 

Axis is positioned at the top of parent ChartArea.

 

Since: 1.0
See also: Constants

 

 

 

POSITION_BOTTOM

 

public static final int POSITION_BOTTOM

 

Axis is positioned to the bottom of parent ChartArea.

 

Since: 1.0
See also: Constants

 

 

 

POSITION_HCENTER

 

public static final int POSITION_HCENTER

 

Axis is positioned horizontally to the center of parent ChartArea.

 

Since: 1.0
See also: Constants

 

 

 

POSITION_VCENTER

 

public static final int POSITION_VCENTER

 

Axis is positioned vertically to the center of parent ChartArea.

 

Since: 1.0
See also: Constants

 

 

 

LABEL_INSIDE

 

public static final int LABEL_INSIDE

 

Labels are rendered inside the axis line.

 

Since: 1.0
See also: Constants

 

 

 

LABEL_OUTSIDE

 

public static final int LABEL_OUTSIDE

 

Labels are rendered outside of axis line.

 

Since: 1.0
See also: Constants

 

 

 

LABEL_CENTER

 

public static final int LABEL_CENTER

 

Labels are centered to axis line.

 

Since: 1.0
See also: Constants

 

 

 

TICK_NONE

 

public static final int TICK_NONE

 

No tick mark is present.

 

Since: 1.0
See also: Constants

 

 

 

TICK_INNER

 

public static final int TICK_INNER

 

Tick mark starts from axis line.

 

Since: 1.0
See also: Constants

 

 

 

TICK_OUTER

 

public static final int TICK_OUTER

 

Tick mark starts from label.

 

Since: 1.0
See also: Constants

 

 

 

TICK_CROSS

 

public static final int TICK_CROSS

 

Tick mark starts from label and crosses axis line.

 

Since: 1.0
See also: Constants

 

 

 

TYPE_NUMBER

 

public static final int TYPE_NUMBER

 

X values of corresponding points collection are considered to be java.lang.Double values.

 

Since: 1.0
See also: Constants

 

 

 

TYPE_DATE

 

public static final int TYPE_DATE

 

X values of corresponding points collection are considered to be java.util.Date values.

 

Since: 1.0
See also: Constants

 

 

 

MODE_RANGE_LABELS

 

public static final int MODE_RANGE_LABELS

 

Indicates that labels for axis are automatically calculated with respect to its range and interval.

 

Since: 1.0
See also: Constants

 

 

 

MODE_SERIES_LABELS

 

public static final int MODE_SERIES_LABELS

 

Indicates that labels for axis are automatically calculated for each point's X value on corresponding ChartSeries.

 

Since: 1.0
See also: Constants

 

 

 

MODE_NO_LABELS

 

public static final int MODE_NO_LABELS

 

Indicates that labels for axis will not be calculated at all.

 

Since: 1.0
See also: getCustomLabels()Constants

 

 

 

 

ChartAxis

 

public ChartAxis( int position)

 

Initializes the new instance of ChartAxis.

 

Parameters:
position-
one of POSITION_LEFT, POSITION_RIGHT, POSITION_TOP, POSITION_BOTTOM, POSITION_HCENTER or POSITION_VCENTER

 

Since: 1.0

 

 

 

 

setPosition

 

public void setPosition( int position)

 

Sets the axis position.

 

Parameters:
position-
one of POSITION_LEFT, POSITION_RIGHT, POSITION_TOP, POSITION_BOTTOM, POSITION_HCENTER or POSITION_VCENTER position constants.

 

Since: 1.0

 

 

 

getPosition

 

public int getPosition( )

 

Gets the axis position.

 

Returns:
one of POSITION_LEFT, POSITION_RIGHT, POSITION_TOP, POSITION_BOTTOM, POSITION_HCENTER or POSITION_VCENTER position constants.

 

Since: 1.0

 

 

 

getGridVisible

 

public boolean getGridVisible( )

 

Gets the value indicating whether axis grid is visible.
 axis.setGridVisible(false);
 

 

Returns:
true if area's grid is visible, otherwise false.

 

Since: 1.0

 

 

 

setGridVisible

 

public void setGridVisible( boolean value)

 

Sets the value indicating whether area grid is visible.

 

Parameters:
value-
true if area's grid should be visible, otherwise false.

 

Since: 1.0

 

 

 

setPadding

 

public void setPadding( int padding)

 

Sets the padding value for axis.

 

Parameters:
padding-
value of padding.

 

Since: 1.0

 

 

 

getPadding

 

public int getPadding( )

 

Gets the padding value for axis.

 

Returns:
value of padding.

 

Since: 1.0

 

 

 

getSpacing

 

public int getSpacing( )

 

Gets value indicating distance between axis elements.

 

Returns:
value of spacing applied to all axis elements.

 

Since: 1.0

 

 

 

setSpacing

 

public void setSpacing( int spacing)

 

Sets value indicating distance between axis elements.

 

Parameters:
spacing-
value of spacing applied to all axis elements.

 

Since: 1.0

 

 

 

setFormat

 

public void setFormat( Format format)

 

Sets the Format instance to use for the labels format.

 

Parameters:
format-
Format instance

 

Since: 1.0

 

 

 

getFormat

 

public Format getFormat( )

 

Gets the Format instance used to format labels.

 

Returns:
Format format.

 

Since: 1.0
See also: setFormat(Format)

 

 

 

setLabelColor

 

public void setLabelColor( int color)

 

Sets axis labels color.

 

Parameters:
color-
color value

 

Since: 1.0

 

 

 

getLabelColor

 

public int getLabelColor( )

 

Gets axis labels color.

 

Returns:
color value

 

Since: 1.0

 

 

 

setLineColor

 

public void setLineColor( int color)

 

Sets axis line color.

 

Parameters:
color-
color value

 

Since: 1.0

 

 

 

getLineColor

 

public int getLineColor( )

 

Gets axis line color.

 

Returns:
color value

 

Since: 1.0

 

 

 

setGridColor

 

public void setGridColor( int color)

 

Sets grid lines color.

 

Parameters:
color-
color value

 

Since: 1.0

 

 

 

getGridColor

 

public int getGridColor( )

 

Gets grid lines color.

 

Returns:
color value

 

Since: 1.0

 

 

 

setTickMode

 

public void setTickMode( int mode)

 

Sets mode for the tick marks.

 

Parameters:
mode-
one of TICK_NONE, TICK_INNER, TICK_OUTER or TICK_CROSS tick mode constants.

 

Since: 1.0

 

 

 

getTickMode

 

public int getTickMode( )

 

Gets mode for the tick marks.

 

Returns:
one of TICK_NONE, TICK_INNER, TICK_OUTER or TICK_CROSS tick mode constants.

 

Since: 1.0

 

 

 

setTickSize

 

public void setTickSize( int size)

 

Sets tick marks size.

 

Parameters:
size-
size in pixels

 

Since: 1.0

 

 

 

getTickSize

 

public int getTickSize( )

 

Gets tick marks size.

 

Returns:
size size in pixels

 

Since: 1.0

 

 

 

setLabelsMode

 

public void setLabelsMode( int mode)

 

Sets value representing logic that should be used to calculate labels for axis.

 

Parameters:
mode-
one of MODE_SERIES_LABELS, MODE_RANGE_LABELS or MODE_NO_LABELS labels mode constants.

 

Since: 1.0

 

 

 

getLabelsMode

 

public int getLabelsMode( )

 

Gets value representing logic that is used to calculate labels for axis.

 

Returns:
one of MODE_SERIES_LABELS, MODE_RANGE_LABELS or MODE_NO_LABELS labels mode constants.

 

Since: 1.0

 

 

 

setValueType

 

public void setValueType( int valueType)

 

Sets the type of value that is used to represent axis labels.

 

Parameters:
valueType-
one of TYPE_NUMBER, TYPE_DATE

 

Since: 1.0

 

 

 

getValueType

 

public int getValueType( )

 

Gets the type of value that is used to represent axis labels.

 

Returns:
valueType one of TYPE_NUMBER, TYPE_DATE

 

Since: 1.0

 

 

 

setShowLabels

 

public void setShowLabels( boolean showLabels)

 

Sets value determining whether labels should be drawn for this axis.

 

Parameters:
showLabels-
true, if labels should be present on this axis, otherwise false.

 

Since: 1.0
See also: getShowLabels()

 

 

 

getShowLabels

 

public boolean getShowLabels( )

 

Gets value identifying whether labels should be shown for this axis.

 

Returns:
true, if labels should be present on this axis, otherwise false.

 

Since: 1.0
See also: setShowLabels(boolean)

 

 

 

getScale

 

public ChartAxisScale getScale( )

 

Gets instance of ChartAxisScale object that is in change of axis range calculations.

 

Returns:
instance of current axis scale.

 

Since: 1.0
See also: ChartAxisScale

 

 

 

setLabelPosition

 

public void setLabelPosition( int position)

 

Sets value indicating how labels should be positioned on axis line.

 

Parameters:
position-
one of LABEL_INSIDE, LABEL_CENTER, LABEL_OUTSIDE

 

Since: 1.0

 

 

 

getLabelPosition

 

public int getLabelPosition( )

 

Gets value indicating how labels should be positioned on axis line.

 

Returns:
one of LABEL_INSIDE, LABEL_CENTER, LABEL_OUTSIDE

 

Since: 1.0

 

 

 

getOrigin

 

public double getOrigin( )

 

Gets the origin value for axis.

 

Returns:
value of origin.

 

Since: 1.0

 

 

 

setOrigin

 

public void setOrigin( double origin)

 

Sets the origin value for axis.

 

Parameters:
origin-
value of origin.

 

Since: 1.0

 

 

 

getTitle

 

public java.lang.String getTitle( )

 

Gets the string representation of axis' title.

 

Returns:
java.lang.String title of axis.

 

Since: 1.0

 

 

 

setTitle

 

public void setTitle( java.lang.String title)

 

Sets the title for axis.

 

Parameters:
title-
string representation of axis' title.

 

Since: 1.0

 

 

 

getBounds

 

public XYRect getBounds( )

 

Gets the rectangular area occupied by axis.

 

Returns:
instance of XYRect

 

Since: 1.0

 

 

 

setLabelAlignment

 

public void setLabelAlignment( int align)

 

Sets labels alignment

 

Parameters:
align-
one of Alignment.NEAR, Alignment.CENTER or Alignment.FAR labels alignment constants.

 

Since: 1.0

 

 

 

getLabelAlignment

 

public int getLabelAlignment( )

 

Gets labels alignment

 

Returns:
one of Alignment.NEAR, Alignment.CENTER or Alignment.FAR labels alignment constnats.

 

Since: 1.0

 

 

 

getStripLines

 

public ChartCollection getStripLines( )

 

Get the strip lines collection.

 

Returns:
collection of strip lines

 

Since: 1.0

 

 

 

getCustomLabels

 

public ChartCollection getCustomLabels( )

 

Get the collection of strip lines.

 

Returns:
collection of strip lines

 

Since: 1.0

 

 

© 2005 - 2010 ArtfulBits. All rights reserved.