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()
IAxis
An axis id is automatically assigned when axis is created.
public IAxis.Direction getDirection()
IAxis
The axis direction is set when axis is created, and won't be changed.
getDirection
in interface IAxis
public IAxis.Position getPosition()
IAxis
getPosition
in interface IAxis
public void setPosition(IAxis.Position position)
IAxis
setPosition
in interface IAxis
position
- the axis positionpublic void setRange(Range range)
IAxis
public void setRange(Range range, boolean update)
range
- the axis rangeupdate
- true if updating the chart layoutpublic void enableLogScale(boolean enabled) throws java.lang.IllegalStateException
IAxis
enableLogScale
in interface IAxis
enabled
- 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()
IAxis
isLogScaleEnabled
in interface IAxis
public IGrid getGrid()
IAxis
public void adjustRange()
IAxis
adjustRange
in interface IAxis
public void adjustRange(boolean update)
update
- true if updating chart layoutpublic void zoomIn()
IAxis
public void zoomIn(double coordinate)
IAxis
public void zoomOut()
IAxis
public void zoomOut(double coordinate)
IAxis
public void scrollUp()
IAxis
public void scrollDown()
IAxis
scrollDown
in interface IAxis
public boolean isCategoryEnabled()
IAxis
isCategoryEnabled
in interface IAxis
public boolean isValidCategoryAxis()
public void enableCategory(boolean enabled)
IAxis
enableCategory
in interface IAxis
enabled
- true if enabling categorypublic void setCategorySeries(java.lang.String[] series)
IAxis
setCategorySeries
in interface IAxis
series
- the category seriespublic java.lang.String[] getCategorySeries()
IAxis
getCategorySeries
in interface IAxis
public int getPixelCoordinate(double dataCoordinate)
IAxis
getPixelCoordinate
in interface IAxis
dataCoordinate
- 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)
IAxis
getDataCoordinate
in interface IAxis
pixelCoordinate
- 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)
IAxis
addDisposeListener
in interface IAxis
listener
- the dispose listenerpublic void updateLayoutData()
public void refresh()
public boolean isDateEnabled()