IAxis.Direction, IAxis.Position| Modifier and Type | Field and Description |
|---|---|
private boolean |
categoryAxisEnabled
the state indicating if axis type is category
|
private java.lang.String[] |
categorySeries
the category series
|
private Chart |
chart
the plot chart
|
static double |
DEFAULT_LOG_SCALE_MAX
the default maximum value of log scale range
|
static double |
DEFAULT_LOG_SCALE_MIN
the default minimum value of log scale range
|
static double |
DEFAULT_MAX
the default maximum value of range
|
static double |
DEFAULT_MIN
the default minimum value of range
|
private IAxis.Direction |
direction
the axis direction
|
private Grid |
grid
the grid
|
private int |
height
the plot area height
|
private int |
id
the axis id
|
private boolean |
isHorizontalAxis
the state indicating if the axis is horizontal
|
private java.util.List<IDisposeListener> |
listeners
the list of dispose listeners
|
private boolean |
logScaleEnabled
the state if the axis scale is log scale
|
static int |
MARGIN
the margin in pixels
|
private double |
max
the maximum value of axis range
|
private static double |
MAX_RESOLUTION
the maximum resolution with digits
|
private double |
min
the minimum value of axis range
|
private int |
numRisers
the number of riser per category
|
private IAxis.Position |
position
the axis position
|
private static double |
SCROLL_RATIO
the ratio to be scrolled
|
private AxisTick |
tick
the axis tick
|
private AxisTitle |
title
the axis title
|
private int |
width
the plot area width
|
private static double |
ZOOM_RATIO
the ratio to be zoomed
|
| Constructor and Description |
|---|
Axis(int id,
IAxis.Direction direction,
Chart chart)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDisposeListener(IDisposeListener listener)
Adds the dispose listener.
|
void |
adjustRange()
Adjusts the axis range to the series belonging to the axis, so that all
series are completely shown.
|
void |
adjustRange(boolean update)
Adjusts the axis range to the series belonging to the axis.
|
protected void |
dispose()
Disposes the resources.
|
void |
enableCategory(boolean enabled)
Enables category.
|
void |
enableLogScale(boolean enabled)
Enables the log scale.
|
java.lang.String[] |
getCategorySeries()
Gets the category series.
|
double |
getDataCoordinate(int pixelCoordinate)
Gets the data coordinate corresponding to the given pixel coordinate on
plot area.
|
double |
getDataCoordinate(int pixelCoordinate,
double lower,
double upper)
Gets the data coordinate corresponding to the given pixel coordinate on
plot area.
|
IAxis.Direction |
getDirection()
Gets the axis direction.
|
IGrid |
getGrid()
Gets the grid.
|
int |
getId()
Gets the axis id.
|
private double |
getMinSeriesValue()
Gets the minimum value of series belonging to this axis.
|
int |
getNumRisers()
Gets the number of risers per category.
|
int |
getPixelCoordinate(double dataCoordinate)
Gets the pixel coordinate corresponding to the given data coordinate.
|
int |
getPixelCoordinate(double dataCoordinate,
double lower,
double upper)
Gets the pixel coordinate corresponding to the given data coordinate.
|
IAxis.Position |
getPosition()
Gets the axis position.
|
Range |
getRange()
Gets the axis range.
|
AxisTick |
getTick()
Gets the axis tick.
|
ITitle |
getTitle()
Gets the axis title.
|
boolean |
isCategoryEnabled()
Gets the state indicating if category is enabled.
|
boolean |
isDateEnabled()
Gets the state indicating if date is enabled.
|
boolean |
isHorizontalAxis()
Checks if the axis is horizontal.
|
boolean |
isLogScaleEnabled()
Gets the state indicating if log scale is enabled.
|
boolean |
isValidCategoryAxis()
Gets the state indicating if the axis is valid category axis.
|
void |
refresh()
Refreshes the cache.
|
void |
scrollDown()
Scrolls up the axis.
|
void |
scrollUp()
Scrolls up the axis.
|
void |
setCategorySeries(java.lang.String[] series)
Sets the category series.
|
void |
setNumRisers(int numRisers)
Sets the number of risers per category.
|
void |
setPosition(IAxis.Position position)
Sets the axis position.
|
void |
setRange(Range range)
Sets the axis range.
|
void |
setRange(Range range,
boolean update)
Sets the axis range.
|
void |
updateLayoutData()
Updates the layout data.
|
void |
zoomIn()
Zooms in the axis.
|
void |
zoomIn(double coordinate)
Zooms in the axis at the given coordinate.
|
void |
zoomOut()
Zooms out the axis.
|
void |
zoomOut(double coordinate)
Zooms out the axis at the given coordinate.
|
public static final int MARGIN
public static final double DEFAULT_MIN
public static final double DEFAULT_MAX
public static final double DEFAULT_LOG_SCALE_MIN
public static final double DEFAULT_LOG_SCALE_MAX
private static final double ZOOM_RATIO
private static final double SCROLL_RATIO
private static final double MAX_RESOLUTION
private int id
private IAxis.Direction direction
private IAxis.Position position
private double min
private double max
private AxisTitle title
private AxisTick tick
private Grid grid
private Chart chart
private boolean logScaleEnabled
private boolean categoryAxisEnabled
private java.lang.String[] categorySeries
private int numRisers
private boolean isHorizontalAxis
private int width
private int height
private java.util.List<IDisposeListener> listeners
public Axis(int id,
IAxis.Direction direction,
Chart chart)
id - the axis indexdirection - the axis direction (X or Y)chart - the chartpublic int getId()
IAxisAn axis id is automatically assigned when axis is created.
public IAxis.Direction getDirection()
IAxisThe axis direction is set when axis is created, and won't be changed.
getDirection in interface IAxispublic IAxis.Position getPosition()
IAxisgetPosition in interface IAxispublic void setPosition(IAxis.Position position)
IAxissetPosition in interface IAxisposition - the axis positionpublic void setRange(Range range)
IAxispublic void setRange(Range range, boolean update)
range - the axis rangeupdate - true if updating the chart layoutpublic void enableLogScale(boolean enabled)
throws java.lang.IllegalStateException
IAxisenableLogScale in interface IAxisenabled - true if enabling log scalesjava.lang.IllegalStateException - if minimum value of series belonging to this axis is less
than zero.private double getMinSeriesValue()
public boolean isLogScaleEnabled()
IAxisisLogScaleEnabled in interface IAxispublic IGrid getGrid()
IAxispublic void adjustRange()
IAxisadjustRange in interface IAxispublic void adjustRange(boolean update)
update - true if updating chart layoutpublic void zoomIn()
IAxispublic void zoomIn(double coordinate)
IAxispublic void zoomOut()
IAxispublic void zoomOut(double coordinate)
IAxispublic void scrollUp()
IAxispublic void scrollDown()
IAxisscrollDown in interface IAxispublic boolean isCategoryEnabled()
IAxisisCategoryEnabled in interface IAxispublic boolean isValidCategoryAxis()
public void enableCategory(boolean enabled)
IAxisenableCategory in interface IAxisenabled - true if enabling categorypublic void setCategorySeries(java.lang.String[] series)
IAxissetCategorySeries in interface IAxisseries - the category seriespublic java.lang.String[] getCategorySeries()
IAxisgetCategorySeries in interface IAxispublic int getPixelCoordinate(double dataCoordinate)
IAxisgetPixelCoordinate in interface IAxisdataCoordinate - the data coordinatepublic int getPixelCoordinate(double dataCoordinate,
double lower,
double upper)
dataCoordinate - the data coordinatelower - the min value of rangeupper - the max value of rangepublic double getDataCoordinate(int pixelCoordinate)
IAxisgetDataCoordinate in interface IAxispixelCoordinate - the pixel coordinate on plot areapublic double getDataCoordinate(int pixelCoordinate,
double lower,
double upper)
pixelCoordinate - the pixel coordinate on plot arealower - the min value of rangeupper - the max value of rangepublic void setNumRisers(int numRisers)
numRisers - the number of risers per categorypublic int getNumRisers()
public boolean isHorizontalAxis()
protected void dispose()
public void addDisposeListener(IDisposeListener listener)
IAxisaddDisposeListener in interface IAxislistener - the dispose listenerpublic void updateLayoutData()
public void refresh()
public boolean isDateEnabled()