All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.JCAxis

java.lang.Object
   |
   +----jclass.chart.TrackChange
           |
           +----jclass.chart.ChartRegion
                   |
                   +----jclass.chart.JCAxis

public class JCAxis
extends ChartRegion
implements JCSerializable
JCAxis controls all attributes relating to rendering axes.

Properties

Name Method
Font The Font property determines what font is used to render text inside the chart region. Note that the Font property is inherited from the parent ChartCanvas.
Foreground The Foreground property determines the foreground color used to draw inside the chart region. Note that the Foreground property is inherited from the parent ChartCanvas.
Background The Background property determines the foreground color used to draw inside the chart region. Note that the Background property is inherited from the parent ChartCanvas.
Top The Top property determines the location of the top of the ChartRegion. The default value is calculated.
TopIsDefault The TopIsDefault property determines whether the top position of the chart region is calculated by Chart (true) or taken from the Top property (false). Default value is true.
Left The Left property determines the location of the left of the ChartRegion. The default value is calculated.
LeftIsDefault The LeftIsDefault property determines whether the left position of the chart region is calculated by Chart (true) or taken from the Left property (false). Default value is true.
Width The Width property determines the width of the ChartRegion. The default value is calculated.
WidthIsDefault The WidthIsDefault property determines whether the width of the chart region is calculated by Chart (true) or taken from the Width property (false). Default value is true.
Height The Height property determines the height of the ChartRegion. The default value is calculated.
HeightIsDefault The HeightIsDefault property determines whether the height of the chart region is calculated by Chart (true) or taken from the Height property (false). Default value is true.
BorderType Determines the style of border drawn around the ChartRegion. Valid values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN, SHADOW_FRAME_OUT. Default value is BWTEnum.SHADOW_IN.
BorderWidth The BorderWidth property determines the width of the border drawn around the region. Default value is 2.
Min The Min property controls the minimum value shown on the axis. The Datamin is determined by JCChart.
MinIsDefault The MinIsDefault property determines whether Chart is responsible for calculating the minimum axis value. If true, Chart will calculate the axis min. If false, Chart will use the provided axis min. Default value is true.
Max The Max property controls the maximum value shown on the axis. The Datamax is determined by JCChart.
MaxIsDefault The MaxIsDefault property determines whether Chart is responsible for calculating the maximum axis value. If true, Chart calculates the axis max. If false, Chart uses the provided axis max. Default value is true.
Origin The Origin property controls location of the origin along the axis. The default value is calculated.
OriginIsDefault The OriginIsDefault property determines whether Chart is responsible for positioning the axis origin. If true, Chart calculates the axis origin. If false, Chart uses the provided axis origin value. Default value is true.
OriginPlacement The OriginPlacement property specifies where the origin is placed. Note that the OriginPlacement property is only active if the Origin property has not been set. Valid values include AUTOMATIC (places origin at minimum value or at zero if there are negative and positive values), ZERO (places origin at zero), MIN (places origin at minimum value on axis) or MAX (places origin at maximum value on axis). Default value is AUTOMATIC.
GridIsShowing The GridIsShowing property determines whether a grid is drawn for the axis. Default value is false.
GridSpacing The GridSpacing property controls the spacing between grid lines relative to the axis. Default value is 0.0.
GridSpacingIsDefault The GridSpacingIsDefault property determines whether Chart is responsible for calculating the grid spacing value. If true, Chart will calculate the grid spacing. If false, Chart will use the provided grid spacing. Default value is true.
GridStyle The GridStyle property controls how grids are drawn. The default value is generated.
IsEditable The IsEditable property determines whether the axis can be affected by edit/translation/zooming. Default value is true.
IsLogarithmic The IsLogarithmic property determines whether the axis will be logarithmic (true) or linear (false). Default value is false.
Title The Title property controls the appearance of the axis title.
IsReversed The IsReversed property of JCAxis determines if the axis order is reversed. Default value is false.
IsShowing The IsShowing property determines whether the associated Axis is currently visible. Default value is true.
Formula The Formula property determines how an axis is related to another axis object. If set, the Formula property overrides all other axis properties. See JCAxisFormula for details.
AnnotationRotation The AnnotationRotation property specifies the rotation of each axis label. Valid values are JCAxis.ROTATE_90, JCAxis.ROTATE_180, JCAxis.ROTATE_270 or JCAxis.ROTATE_NONE. Default value is JCAxis.ROTATE_NONE.
Placement The Placement property determines the method used to place the axis. Valid values include JCAxis.AUTOMATIC (Chart chooses an appropriate location), JCAxis.ORIGIN (appears at the origin of another axis, specified via the PlacementAxis property), JCAxis.MIN (appears at the minimum axis value), JCAxis.MAX (appears at the maximum axis value) or JCAxis.VALUE_ANCHORED (appears at a particular value along another axis, specified via the PlacementAxis property). Default value is AUTOMATIC.
PlacementAxis The PlacementAxis property determines the axis that controls the placement of this axis. In JCChart, it is possible to position an axis at a particular position on another axis (in conjunction with the PlacementLocation property or the Placement property). Default value is null.
PlacementLocation The PlacementLocation property is used with the PlacementAxis property to position the current axis object at a particular point on another axis. Default value is 0.0.
AnnotationMethod The AnnotationMethod property determines how axis annotations are generated. Valid values include JCAxis.VALUE (axis annotations are generated by chart, with possible callbacks to a label generator), JCAxis.VALUE_LABELS (axis annotations are taken from a list of value labels provided by the user. Note that a value label is a label that is to appear at a particular value along the axis), JCAxis.POINT_LABELS (axis annotations come from the data source in the form of point labels ie labels associated with particular data points) and JCAxis.TIME_LABELS (chart generates time/date/labels based on the TimeUnit, TimeBase and TimeFormat properties). Default value is JCAxis.VALUE.
Precision The Precision property controls the number of zeros that appear after the decimal place in chart-generated axis labels. The default value is calculated.
PrecisionIsDefault The PrecisionIsDefault determines whether Chart is responsible for calculating the numbering precision. If true, Chart will calculate the precision. If false, Chart will use the provided precision. Default value is true.
NumSpacing The NumSpacing property controls the interval between axis labels. The default value is calculated.
NumSpacingIsDefault The NumSpacingIsDefault property determines whether Chart is responsible for calculating the numbering spacing. If true, Chart will calculate the spacing. If false, Chart will use the provided numbering spacing. Default value is true.
TickSpacing The TickSpacing property controls the interval between tick lines on the axis. Note: if the AnnotationMethod property is set to POINT_LABELS, tick lines appear at point values. The default value is calculated.
TickSpacingIsDefault The TickSpacingIsDefault property determines whether Chart is responsible for calculating the tick spacing. If true, Chart will calculate the tick spacing. If false, Chart will use the provided tick spacing. Default value is true.
TimeUnit The TimeUnit property controls the unit of time used for labelling a time labelled axis. Valid TimeUnit values include JCAxis.SECONDS, JCAxis.MINUTES, JCAxis.HOURS, JCAxis.DAYS, JCAxis.WEEKS, JCAxis.MONTHS and JCAxis.YEARS. Default value is JCAxis.SECONDS.
TimeBase The TimeBase property defines the start time for the axis. Default value is the current time.
TimeFormat The TimeFormat property controls the format used to generate time labels for time labelled axes. The formats supported are similar to those supported by the C function strftime(). Default value is calculated based on TimeUnit.
TimeFormatIsDefault The TimeFormatIsDefault property determines whether a time label format is generated automatically, or the user value for TimeFormat is used. Default value is true.
LabelGenerator The LabelGenerator property holds a reference to an object that implements the JCLabelGenerator interface. This interface is used to externally generate labels if the AnnotationMethod property is set to JCAxis.VALUE. Default value is null.
Gap The Gap property determines the amount of space left between adjacent axis annotations.


Variable Index

 o AUTOMATIC
 o DAYS
 o formula
 o HOURS
 o MAX
 o MIN
 o MINUTES
 o MONTHS
 o ORIGIN
 o POINT_LABELS
 o ROTATE_180
 o ROTATE_270
 o ROTATE_90
 o ROTATE_NONE
 o SECONDS
 o TIME_LABELS
 o title
 o VALUE
 o VALUE_ANCHORED
 o VALUE_LABELS
 o WEEKS
 o YEARS
 o ZERO

Constructor Index

 o JCAxis()
Default constructor
 o JCAxis(JCChartArea, boolean, int)
Constructs a JCAxis object given the parent JCChartArea and a boolean indicating whether the axis is vertical or horizontal.

Method Index

 o addValueLabel(JCValueLabel)
Adds the provided value label to the list of value labels.
 o adjustPlotRect()
Adjusts the plot area of the parent ChartArea to account for this axis.
 o dateToValue(Date)
 o draw(Graphics)
Overrides ChartRegion.draw() to ensure that a border is not drawn around the axis.
 o getAnnotationMethod()
Gets the value of the AnnotationMethod property.
 o getAnnotationRotation()
Gets the AnnotationRotation property of the JCAxis.
 o getFormula()
Retrieves the JCAxisFormula object, which specifies a relationship between this JCAxis object and another JCAxis object.
 o getGap()
Gets the value of the Gap property.
 o getGridIsShowing()
Gets the value of the GridIsShowing property.
 o getGridSpacing()
Gets the GridSpacing property.
 o getGridSpacingIsDefault()
Gets the GridSpacingIsDefault property of JCAxisBounds.
 o getGridStyle()
Gets the GridStyle property.
 o getIsEditable()
Gets the IsEditable property.
 o getIsLogarithmic()
Gets the IsLogarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).
 o getIsReversed()
Gets the IsReversed property of JCAxis, which determines if the axis order is reversed.
 o getIsVertical()
Gets the value of the IsVertical property.
 o getLabelGenerator()
Gets the value of the LabelGenerator property.
 o getMax()
Gets the Max property of the JCAxis, which controls the maximum value shown on the axis.
 o getMaxIsDefault()
Gets the MaxIsDefault property.
 o getMin()
Gets the Min property of the JCAxis, which controls the minimum value shown on the axis.
 o getMinIsDefault()
Gets the MinIsDefault property.
 o getNumSpacing()
Gets the NumSpacing property of the Axis, which controls the interval between axis labels.
 o getNumSpacingIsDefault()
Gets the NumSpacingIsDefault property of JCAxis.
 o getOrigin()
Gets the Origin property of the Axis, which controls the location of the origin along the axis.
 o getOriginIsDefault()
Gets the OriginIsDefault property.
 o getOriginPlacement()
Gets the OriginPlacement property of the JCAxis, which specifies where the origin is placed.
 o getPlacement()
Gets the Placement property of the JCAxis, which controls where the axis is placed.
 o getPlacementAxis()
Gets the PlacementAxis property of the axis.
 o getPlacementLocation()
Gets the value of the PlacementLocation property.
 o getPrecision()
Gets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.
 o getPrecisionIsDefault()
Gets the PrecisionIsDefault property of JCAxis.
 o getTickSpacing()
Gets the TickSpacing property, which controls the interval between tick lines on the axis.
 o getTickSpacingIsDefault()
Gets the TickSpacingIsDefault property of JCAxis.
 o getTimeBase()
Gets the value of the TimeBase property.
 o getTimeFormat()
Gets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.
 o getTimeFormatIsDefault()
Gets the value of the TimeFormatIsDefault property.
 o getTimeUnit()
Gets the value of the TimeUnit property.
 o getTitle()
Retrieves the JCAxisTitle object, which controls the appearance of the axis title.
 o getValueLabel(double)
Retrieves the value label for the specified value.
 o getValueLabels()
Gets the value of the ValueLabels property.
 o getValueLabels(int)
 o recalc()
Recalculates the axis parameters.
 o reshape(int, int, int, int)
Overridden reshape() method that makes sure the scale and shift values are recalculated when the axis size or position changes.
 o setAnnotationMethod(int)
Sets the value of the AnnotationMethod property.
 o setAnnotationRotation(int)
Sets the AnnotationRotation property of the JCAxis.
 o setGap(int)
Sets the value of the Gap property.
 o setGridIsShowing(boolean)
Sets the value of the GridIsShowing property.
 o setGridSpacing(double)
Gets the GridSpacing property.
 o setGridSpacingIsDefault(boolean)
Sets the GridSpacingIsDefault property of JCAxisBounds.
 o setGridStyle(JCChartStyle)
Sets the GridStyle property.
 o setIsEditable(boolean)
Sets the IsEditable property.
 o setIsLogarithmic(boolean)
Sets the IsLogarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).
 o setIsReversed(boolean)
Sets the IsReversed property of JCAxis, which determines if the axis order is reversed.
 o setIsVertical(boolean)
Sets the value of the IsVertical property.
 o setLabelGenerator(JCLabelGenerator)
Sets the value of the LabelGenerator property.
 o setMax(double)
Sets the Max property of the Axis, which controls the maximum value shown on the axis.
 o setMaxIsDefault(boolean)
Sets the MaxIsDefault property.
 o setMin(double)
Sets the Min property of the JCAxis, which controls the minimum value shown on the axis.
 o setMinIsDefault(boolean)
Sets the MinIsDefault property.
 o setNumSpacing(double)
Sets the NumSpacing property of the Axis, which controls the interval between axis labels.
 o setNumSpacingIsDefault(boolean)
Sets the NumSpacingIsDefault property of JCAxis.
 o setOrigin(double)
Sets the Origin property of the Axis, which controls the location of the origin along the axis.
 o setOriginIsDefault(boolean)
Sets the OriginIsDefault property.
 o setOriginPlacement(int)
Sets the OriginPlacement property of the JCAxis, which specifies where the origin is placed.
 o setParent(ChartCanvas)
Connects the chart region to a ChartCanvas.
 o setPlacement(int)
Sets the Placement property of the JCAxis, which controls where the axis is placed.
 o setPlacement(JCAxis)
Convenience method that sets the Placement property to ORIGIN, and sets the PlacementAxis property to the provided value
 o setPlacement(JCAxis, double)
Convenience method that sets the Placement property to VALUE_ANCHORED, the PlacementAxis property to the provided axis, and the PlacementLocation property to the provided floating- point value.
 o setPlacementAxis(JCAxis)
Sets the PlacementAxis property of the axis.
 o setPlacementLocation(double)
Sets the value of the PlacementLocation property.
 o setPrecision(int)
Sets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.
 o setPrecisionIsDefault(boolean)
Sets the PrecisionIsDefault property of JCAxis.
 o setTickSpacing(double)
Sets the TickSpacing property, which controls the interval between tick lines on the axis.
 o setTickSpacingIsDefault(boolean)
Sets the TickSpacingIsDefault property of JCAxis.
 o setTimeBase(Date)
Sets the value of the TimeBase property.
 o setTimeFormat(String)
Sets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.
 o setTimeFormatIsDefault(boolean)
Sets the value of the TimeFormatIsDefault property.
 o setTimeUnit(long)
Sets the value of the TimeUnit property.
 o setTitle(JCAxisTitle)
Sets the JCAxisTitle object associated with the JCAxis.
 o setValueLabels(int, JCValueLabel)
 o setValueLabels(JCValueLabel[])
Sets the value of the ValueLabels property.
 o toData(int)
Converts a pixel value relative to the parent JCChartArea to a value in the data space.
 o toPixel(double)
Converts a data value along the axis to a pixel value.
 o toString()
String representation of the axis.
 o valueToDate(double)

Variables

 o title
  protected JCAxisTitle title
 o formula
  protected JCAxisFormula formula
 o SECONDS
  public final static long SECONDS
 o MINUTES
  public final static long MINUTES
 o HOURS
  public final static long HOURS
 o DAYS
  public final static long DAYS
 o WEEKS
  public final static long WEEKS
 o MONTHS
  public final static long MONTHS
 o YEARS
  public final static long YEARS
 o AUTOMATIC
  public final static int AUTOMATIC
 o MIN
  public final static int MIN
 o MAX
  public final static int MAX
 o ZERO
  public final static int ZERO
 o VALUE_ANCHORED
  public final static int VALUE_ANCHORED
 o ORIGIN
  public final static int ORIGIN
 o VALUE
  public final static int VALUE
 o VALUE_LABELS
  public final static int VALUE_LABELS
 o TIME_LABELS
  public final static int TIME_LABELS
 o POINT_LABELS
  public final static int POINT_LABELS
 o ROTATE_NONE
  public final static int ROTATE_NONE
 o ROTATE_90
  public final static int ROTATE_90
 o ROTATE_180
  public final static int ROTATE_180
 o ROTATE_270
  public final static int ROTATE_270

Constructors

 o JCAxis
  public JCAxis(JCChartArea parent,
                boolean vert,
                int meth)
Constructs a JCAxis object given the parent JCChartArea and a boolean indicating whether the axis is vertical or horizontal.

Parameters:
parent - parent JCChartArea object. All axes must be attached to a JCChartArea, as they are derived from ChartRegion.
vert - if true, the axis is a vertical axis. Otherwise, the axis is considered horizontal.
type - Axis
 o JCAxis
  public JCAxis()
Default constructor

Methods

 o setParent
  public void setParent(ChartCanvas p)
Connects the chart region to a ChartCanvas.

Overrides:
setParent in class ChartRegion
 o getGridIsShowing
  public boolean getGridIsShowing()
Gets the value of the GridIsShowing property. The GridIsShowing property determines whether a grid is drawn for the axis.

Returns:
true if the grid should appear, false otherwise
 o setGridIsShowing
  public void setGridIsShowing(boolean nis)
Sets the value of the GridIsShowing property. The GridIsShowing property determines whether a grid is drawn for the axis.

Returns:
true if the grid should appear, false otherwise
 o getGridSpacing
  public double getGridSpacing()
Gets the GridSpacing property. The GridSpacing property controls the spacing between grid lines relative to the axis.

Returns:
floating-point number representing the axis value spacing between grid lines. A value of 0.0 indicates that grid lines will not be shown.
 o setGridSpacing
  public synchronized void setGridSpacing(double space)
Gets the GridSpacing property. The GridSpacing property controls the spacing between grid lines relative to the axis.

Parameters:
space - floating-point number representing the axis value spacing between grid lines. A value of 0.0 indicates that grid lines will not be shown.
 o setGridSpacingIsDefault
  public synchronized void setGridSpacingIsDefault(boolean useDef)
Sets the GridSpacingIsDefault property of JCAxisBounds. The GridSpacingIsDefault property determines whether Chart is responsible for calculating the grid spacing value. If true, Chart will calculate the grid spacing. If false, Chart will use the provided grid spacing.

Parameters:
useDef - true indicates that chart calculates the GridSpacing property. If false, the GridSpacing property is already specified.
 o getGridSpacingIsDefault
  public boolean getGridSpacingIsDefault()
Gets the GridSpacingIsDefault property of JCAxisBounds. The GridSpacingIsDefault property determines whether Chart is responsible for calculating the grid spacing value. If true, Chart will calculate the grid spacing. If false, Chart will use the provided grid spacing.

Returns:
true indicates that chart calculates the GridSpacing property. If false, the GridSpacing property is already specified.
 o getGridStyle
  public JCChartStyle getGridStyle()
Gets the GridStyle property. The GridStyle property controls the appearance of the grid.

Returns:
JCChartStyle object that controls the grid's appearance
 o setGridStyle
  public synchronized void setGridStyle(JCChartStyle style)
Sets the GridStyle property. The GridStyle property controls the appearance of the grid.

Parameters:
style - JCChartStyle object that controls the grid's appearance
 o setIsLogarithmic
  public synchronized void setIsLogarithmic(boolean log)
Sets the IsLogarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).

Parameters:
log - If true, the axis will be logarithmic (base 10). Otherwise, the axis will be linear.
 o getIsLogarithmic
  public boolean getIsLogarithmic()
Gets the IsLogarithmic property of JCAxis, which determines whether the axis will be logarithmic (true) or linear (false).

Returns:
if true, the axis will be logarithmic (base 10). Otherwise, the axis will be linear.
 o setIsEditable
  public synchronized void setIsEditable(boolean b)
Sets the IsEditable property. The IsEditable property determines whether the axis can be affected by edit/translation/zooming.

Parameters:
b - if true, the axis can be affected by an edit, translation or zoom action. If false, the axis is static.
 o getIsEditable
  public boolean getIsEditable()
Gets the IsEditable property. The IsEditable property determines whether the axis can be affected by edit/translation/zooming.

Returns:
if true, the axis can be affected by an edit, translation or zoom action. If false, the axis is static.
 o setMin
  public synchronized void setMin(double nmin)
Sets the Min property of the JCAxis, which controls the minimum value shown on the axis.

Parameters:
min - minimum value
 o getMin
  public double getMin()
Gets the Min property of the JCAxis, which controls the minimum value shown on the axis.

Returns:
minimum value
 o setMinIsDefault
  public synchronized void setMinIsDefault(boolean useDef)
Sets the MinIsDefault property. The MinIsDefault property determines whether Chart is responsible for calculating the minimum axis value. If true, Chart will calculate the axis min. If false, Chart will use the provided axis min.

Parameters:
useDef - if true, Chart calculates the Min property. If false, the Min property is already specified.
 o getMinIsDefault
  public boolean getMinIsDefault()
Gets the MinIsDefault property. The MinIsDefault property determines whether Chart is responsible for calculating the minimum axis value. If true, Chart will calculate the axis min. If false, Chart will use the provided axis min.

Returns:
true Chart calculates the Min property. If false, the Min property is already specified.
 o setMax
  public synchronized void setMax(double nmax)
Sets the Max property of the Axis, which controls the maximum value shown on the axis.

Parameters:
max - maximum value
 o getMax
  public double getMax()
Gets the Max property of the JCAxis, which controls the maximum value shown on the axis.

Returns:
maximum value
 o setMaxIsDefault
  public synchronized void setMaxIsDefault(boolean useDef)
Sets the MaxIsDefault property. The MaxIsDefault property determines whether Chart is responsible for calculating the maximum axis value. If true, Chart calculates the axis max. If false, Chart uses the provided axis max.

Parameters:
useDef - if true, Chart calculates the Max property. If false, the Max property is already specified.
 o getMaxIsDefault
  public boolean getMaxIsDefault()
Gets the MaxIsDefault property. The MaxIsDefault property determines whether Chart is responsible for calculating the maximum axis value. If true, Chart calculates the axis max. If false, Chart uses the provided axis max.

Returns:
true Chart calculates the Max property. If false, the Max property is already specified.
 o setOrigin
  public synchronized void setOrigin(double oval)
Sets the Origin property of the Axis, which controls the location of the origin along the axis.

Parameters:
oval - origin value
 o getOrigin
  public double getOrigin()
Gets the Origin property of the Axis, which controls the location of the origin along the axis.

Returns:
origin value
 o setOriginIsDefault
  public synchronized void setOriginIsDefault(boolean useDef)
Sets the OriginIsDefault property. The OriginIsDefault property determines whether Chart is responsible for positioning the axis origin. If true, Chart calculates the axis origin. If false, Chart uses the provided axis origin value.

Parameters:
useDef - if true Chart calculates the Origin property. If false, the Origin property is already specified.
 o getOriginIsDefault
  public boolean getOriginIsDefault()
Gets the OriginIsDefault property. The OriginIsDefault property determines whether Chart is responsible for positioning the axis origin. If true, Chart will calculate the axis origin. If false, Chart will use the provided axis origin value.

Returns:
true Chart calculates the Origin property. If false, the Origin property is already specified.
 o setOriginPlacement
  public synchronized void setOriginPlacement(int place)
Sets the OriginPlacement property of the JCAxis, which specifies where the origin is placed. Note that the OriginPlacement property is only active if the Origin property has not been set.

Parameters:
place - one of AUTOMATIC (places origin at minimum value or at zero if there are negative and positive values), ZERO (places origin at zero), MIN (places origin at minimum value on axis) or MAX (places origin at maximum value on axis)
Throws: IllegalArgumentException
If OriginPlacement isn't one of AUTOMATIC, ZERO, MIN or MAX.
 o getOriginPlacement
  public int getOriginPlacement()
Gets the OriginPlacement property of the JCAxis, which specifies where the origin is placed.

Returns:
one of AUTOMATIC (places origin at minimum value or at zero if there are negative and positive values), ZERO (places origin at zero), MIN (places origin at minimum value on axis) or MAX (places origin at maximum value on axis)
 o getTitle
  public JCAxisTitle getTitle()
Retrieves the JCAxisTitle object, which controls the appearance of the axis title.

Returns:
JCAxisTitle object
See Also:
JCAxisTitle
 o setTitle
  public synchronized void setTitle(JCAxisTitle props)
Sets the JCAxisTitle object associated with the JCAxis. JCAxisTitle controls the appearance of the axis title. This method is only accessible inside the chart package.

Parameters:
props - new JCAxisTitle object.
See Also:
JCAxisTitle
 o setIsReversed
  public synchronized void setIsReversed(boolean rev)
Sets the IsReversed property of JCAxis, which determines if the axis order is reversed.

Parameters:
rev - true if the axis is reversed, false otherwise
 o getIsReversed
  public boolean getIsReversed()
Gets the IsReversed property of JCAxis, which determines if the axis order is reversed.

Returns:
true if the axis is reversed, false otherwise
 o getFormula
  public JCAxisFormula getFormula()
Retrieves the JCAxisFormula object, which specifies a relationship between this JCAxis object and another JCAxis object.

Returns:
JCAxisFormula object
See Also:
JCAxisFormula
 o setAnnotationRotation
  public synchronized void setAnnotationRotation(int rot)
Sets the AnnotationRotation property of the JCAxis. The AnnotationRotation property specifies the rotation of each axis label. Valid values are JCAxis.ROTATE_90, JCAxis.ROTATE_180, JCAxis.ROTATE_270 or JCAxis.ROTATE_NONE

Parameters:
rot - one of ROTATE_90, ROTATE_180, ROTATE_270 or ROTATE_NONE
Throws: IllegalArgumentException
If the provided rotation value is not part of the ROTATE_ enum.
 o getAnnotationRotation
  public int getAnnotationRotation()
Gets the AnnotationRotation property of the JCAxis. The AnnotationRotation property specifies the rotation of each axis label. Valid values are JCAxis.ROTATE_90, JCAxis.ROTATE_180, JCAxis.ROTATE_270 or JCAxis.ROTATE_NONE.

Returns:
one of ROTATE_90, ROTATE_180, ROTATE_270 or ROTATE_NONE
 o setPlacement
  public synchronized void setPlacement(int place)
Sets the Placement property of the JCAxis, which controls where the axis is placed.

Parameters:
place - one of AUTOMATIC (Chart chooses an appropriate location), ORIGIN (appears at the origin value), MIN (appears at the minimum axis value), MAX (appears at the maximum axis value) or VALUE_ANCHORED (appears at a particular value along another axis. Note that x axis labels, for example, will be placed at either the y axis origin, y axis max or y axis min value.
Throws: IllegalArgumentException
If the Placement value is not one of AUTOMATIC, ORIGIN, MIN, MAX or VALUE_ANCHORED.
 o setPlacement
  public synchronized void setPlacement(JCAxis ax)
Convenience method that sets the Placement property to ORIGIN, and sets the PlacementAxis property to the provided value

Parameters:
ax - new value for PlacementAxis.
 o setPlacement
  public synchronized void setPlacement(JCAxis ax,
                                        double v)
Convenience method that sets the Placement property to VALUE_ANCHORED, the PlacementAxis property to the provided axis, and the PlacementLocation property to the provided floating- point value.

Parameters:
ax - new value for PlacementAxis
v - new value for PlacementLocation
 o getPlacement
  public int getPlacement()
Gets the Placement property of the JCAxis, which controls where the axis is placed.

Returns:
one of AUTOMATIC (Chart chooses an appropriate location), ORIGIN (appears at the origin value), MIN (Appears at the minimum axis value) and MAX (appears at the maximum axis value). Note that x axis labels, for example, will be placed at either the y axis origin, y axis max or y axis min value.
 o setPlacementAxis
  public synchronized void setPlacementAxis(JCAxis ax)
Sets the PlacementAxis property of the axis. The PlacementAxis property determines the axis that controls the placement of this axis. In JCChart, it is possible to position an axis at a particular position on another axis (in conjunction with the PlacementLocation property or the Placement property).

Parameters:
ax - axis to be used to position this axis.
 o getPlacementAxis
  public JCAxis getPlacementAxis()
Gets the PlacementAxis property of the axis. The PlacementAxis property determines the axis that controls the placement of this axis. In JCChart, it is possible to position an axis at a particular position on another axis (in conjunction with the PlacementLocation property or the Placement property).

Returns:
axis to be used to position this axis.
 o setPlacementLocation
  public synchronized void setPlacementLocation(double v)
Sets the value of the PlacementLocation property. The PlacementLocation property is used with the PlacementAxis property to position the current axis object at a particular point on another axis.

Parameters:
v - Floating-point data value on PlacementAxis at which to place the current axis.
 o getPlacementLocation
  public double getPlacementLocation()
Gets the value of the PlacementLocation property. The PlacementLocation property is used with the PlacementAxis property to position the current axis object at a particular point on another axis.

Returns:
Floating-point data value on PlacementAxis at which to place the current axis.
 o setAnnotationMethod
  public synchronized void setAnnotationMethod(int newMethod)
Sets the value of the AnnotationMethod property. The AnnotationMethod property determines how axis annotations are generated.

Parameters:
newMethod - one of VALUE, VALUE_LABELS, TIME_LABELS or POINT_LABELS
Throws: IllegalArgumentException
If the AnnotationMethod value is not one of VALUE, VALUE_LABELS, TIME_LABELS or POINT_LABELS.
 o getAnnotationMethod
  public int getAnnotationMethod()
Gets the value of the AnnotationMethod property. The AnnotationMethod property determines how axis annotations are generated.

Returns:
One of VALUE, VALUE_LABELS, TIME_LABELS or POINT_LABELS
 o setPrecision
  public synchronized void setPrecision(int prec)
Sets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.

Parameters:
prec - number of zeros after the decimal place. If negative, it specifies the number of zeros that appear before the decimal place.
 o getPrecision
  public int getPrecision()
Gets the Precision property of the Axis, which controls the number of zeros that appear after the decimal place in the axis label.

Returns:
number of zeros after the decimal place. If negative, specifies the number of zeros that appear before the decimal place.
 o setPrecisionIsDefault
  public synchronized void setPrecisionIsDefault(boolean useDef)
Sets the PrecisionIsDefault property of JCAxis. The PrecisionIsDefault determines whether Chart is responsible for calculating the numbering precision. If true, Chart will calculate the precision. If false, Chart will use the provided precision.

Parameters:
useDef - true tells Chart to calculate the Precision property, whereas false means that the Precision property is already specified
 o getPrecisionIsDefault
  public boolean getPrecisionIsDefault()
Gets the PrecisionIsDefault property of JCAxis. The PrecisionIsDefault determines whether Chart is responsible for calculating the numbering precision. If true, Chart will calculate the precision. If false, Chart will use the provided precision.

Returns:
true tells Chart to calculate the Precision property, whereas false means that the Precision property is already specified
 o setNumSpacing
  public synchronized void setNumSpacing(double inc)
Sets the NumSpacing property of the Axis, which controls the interval between axis labels.

Parameters:
inc - interval between axis labels
 o getNumSpacing
  public double getNumSpacing()
Gets the NumSpacing property of the Axis, which controls the interval between axis labels.

Returns:
interval between axis labels
 o setNumSpacingIsDefault
  public synchronized void setNumSpacingIsDefault(boolean useDef)
Sets the NumSpacingIsDefault property of JCAxis. The NumSpacingIsDefault determines whether Chart is responsible for calculating the numbering spacing. If true, Chart will calculate the spacing. If false, Chart will use the provided numbering spacing.

Parameters:
useDef - true tells Chart to calculate the NumSpacing property, whereas false means the NumSpacing property is already specified
 o getNumSpacingIsDefault
  public boolean getNumSpacingIsDefault()
Gets the NumSpacingIsDefault property of JCAxis. The NumSpacingIsDefault determines whether Chart is responsible for calculating the numbering spacing. If true, Chart will calculate the spacing. If false, Chart will use the provided numbering spacing.

Returns:
true tells Chart to calculate the NumSpacing property, whereas false means the NumSpacing property is already specified
 o getTickSpacing
  public double getTickSpacing()
Gets the TickSpacing property, which controls the interval between tick lines on the axis. Note: if the AnnotationMethod property is set to POINT_LABELS, tick lines appear at point values.

Returns:
interval between ticks
 o setTickSpacing
  public synchronized void setTickSpacing(double tick)
Sets the TickSpacing property, which controls the interval between tick lines on the axis.

Parameters:
tick - interval between ticks
 o setTickSpacingIsDefault
  public synchronized void setTickSpacingIsDefault(boolean useDef)
Sets the TickSpacingIsDefault property of JCAxis. The TickSpacingIsDefault determines whether Chart is responsible for calculating the tick spacing. If true, Chart will calculate the tick spacing. If false, Chart will use the provided tick spacing.

Parameters:
useDef - true tells Chart to calculate the TickSpacing property, whereas false means that the TickSpacing property is already specified
 o getTickSpacingIsDefault
  public boolean getTickSpacingIsDefault()
Gets the TickSpacingIsDefault property of JCAxis. The TickSpacingIsDefault determines whether Chart is responsible for calculating the tick spacing. If true, Chart will calculate the tick spacing. If false, Chart will use the provided tick spacing.

Returns:
true tells Chart to calculate the TickSpacing property, whereas false means that the TickSpacing property is already specified
 o setLabelGenerator
  public synchronized void setLabelGenerator(JCLabelGenerator lg)
Sets the value of the LabelGenerator property. The LabelGenerator property holds a reference to an object that implements the JCLabelGenerator interface. This interface is used to externally generate labels.

Parameters:
lg - reference to object instance used to generate labels.
 o getLabelGenerator
  public JCLabelGenerator getLabelGenerator()
Gets the value of the LabelGenerator property. The LabelGenerator property holds a reference to an object that implements the JCLabelGenerator interface. This interface is used to externally generate labels.

Returns:
reference to object instance used to generate labels.
 o setTimeUnit
  public synchronized void setTimeUnit(long tu)
Sets the value of the TimeUnit property. The TimeUnit property controls the unit of time used for labelling a time labelled axis.

Parameters:
tu - Unit of time; one of SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARS.
 o getTimeUnit
  public long getTimeUnit()
Gets the value of the TimeUnit property. The TimeUnit property controls the unit of time used for labelling a time labelled axis.

Returns:
Unit of time; one of SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARS.
 o setTimeBase
  public synchronized void setTimeBase(Date nb)
Sets the value of the TimeBase property. The TimeBase property defines the start time for the axis.

Parameters:
nb - Date object representing the start time for the axis.
 o getTimeBase
  public Date getTimeBase()
Gets the value of the TimeBase property. The TimeBase property defines the start time for the axis.

Returns:
Date object representing the start time for the axis.
 o setTimeFormat
  public synchronized void setTimeFormat(String tf)
Sets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.

Parameters:
tf - format string for time labels.
 o getTimeFormat
  public String getTimeFormat()
Gets the value of the TimeFormat property The TimeFormat property controls the format used to generate time labels for time labelled axes.

Returns:
format string for time labels.
 o setTimeFormatIsDefault
  public synchronized void setTimeFormatIsDefault(boolean ud)
Sets the value of the TimeFormatIsDefault property. The TimeFormatIsDefault property determines whether a time label format is generated automatically, or the user value for TimeFormat is used.

Parameters:
ud - true if a default will be generated, false if the user value will be used.
 o getTimeFormatIsDefault
  public boolean getTimeFormatIsDefault()
Gets the value of the TimeFormatIsDefault property. The TimeFormatIsDefault property determines whether a time label format is generated automatically, or the user value for TimeFormat is used.

Returns:
true if a default will be generated, false if the user value will be used.
 o setIsVertical
  public synchronized void setIsVertical(boolean v)
Sets the value of the IsVertical property. The IsVertical property determines whether the axis is vertically oriented or horizontally oriented.

Parameters:
v - If true, the axis is vertical. Otherwise, it is horizontal.
 o getIsVertical
  public boolean getIsVertical()
Gets the value of the IsVertical property. The IsVertical property determines whether the axis is vertically oriented or horizontally oriented.

Returns:
If true, the axis is vertical. Otherwise, it is horizontal.
 o setGap
  public synchronized void setGap(int gp)
Sets the value of the Gap property. The Gap property determines the amount of space left between adjacent axis annotations.

Parameters:
gp - Space between labels. Must be >= 0
 o getGap
  public int getGap()
Gets the value of the Gap property. The Gap property determines the amount of space left between adjacent axis annotations.

Returns:
Space between labels. Must be >= 0
 o getValueLabel
  public JCValueLabel getValueLabel(double val)
Retrieves the value label for the specified value. Note that floating point does not allow an exact match, so the closest value within a specified error is found

Parameters:
val - data value for which to find the value label
Returns:
JCValueLabel instance
 o addValueLabel
  public void addValueLabel(JCValueLabel vl)
Adds the provided value label to the list of value labels. If the AnnotationMethod is VALUE_LABELS, then the value label will appear at the appropriate point along the axis.

Parameters:
vl - JCValueLabel instance to add
 o toPixel
  public int toPixel(double v)
Converts a data value along the axis to a pixel value. The pixel value is valid inside the parent JCChartArea.

Parameters:
v - data value to convert to a screen location
Returns:
screen location in pixels
 o toData
  public double toData(int v)
Converts a pixel value relative to the parent JCChartArea to a value in the data space. In effect, this routine performs mapping along a particular axis.

Parameters:
v - screen value (in pixels) to convert to a data value. Must be relative to the plot area.
Returns:
data value corresponding to the screen location
 o getValueLabels
  public JCValueLabel[] getValueLabels()
Gets the value of the ValueLabels property. The ValueLabels property is an indexed property containing a list of all annotations for an axis.

 o setValueLabels
  public void setValueLabels(JCValueLabel vl[])
Sets the value of the ValueLabels property. The ValueLabels property is an indexed property containing a list of all annotations for an axis.

 o getValueLabels
  public JCValueLabel getValueLabels(int indx)
 o setValueLabels
  public synchronized void setValueLabels(int index,
                                          JCValueLabel vl)
 o toString
  public String toString()
String representation of the axis. Used by jclass.beans.IndexedPropertyEditor to name the axis.

Overrides:
toString in class Object
 o draw
  public void draw(Graphics gc)
Overrides ChartRegion.draw() to ensure that a border is not drawn around the axis.

Overrides:
draw in class ChartRegion
 o reshape
  public void reshape(int newx,
                      int newy,
                      int neww,
                      int newh)
Overridden reshape() method that makes sure the scale and shift values are recalculated when the axis size or position changes.

Overrides:
reshape in class ChartRegion
 o recalc
  public void recalc()
Recalculates the axis parameters. This method is just a placeholder for now, since axis recalculation is distributed inside recalc() for JCChartArea.

Overrides:
recalc in class ChartRegion
 o dateToValue
  public double dateToValue(Date d)
 o valueToDate
  public Date valueToDate(double v)
 o adjustPlotRect
  protected void adjustPlotRect()
Adjusts the plot area of the parent ChartArea to account for this axis. Takes the axis placement into account.


All Packages  Class Hierarchy  This Package  Previous  Next  Index