Package org.swtchart
Interface IAxis
-
- All Known Implementing Classes:
Axis
public interface IAxis
An axis which is composed of title and tick. Grid is associated with axis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IAxis.Direction
An axis directionstatic class
IAxis.Position
An axis position
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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
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.IAxis.Direction
getDirection()
Gets the axis direction.IGrid
getGrid()
Gets the grid.int
getId()
Gets the axis id.int
getPixelCoordinate(double dataCoordinate)
Gets the pixel coordinate corresponding to the given data coordinate.IAxis.Position
getPosition()
Gets the axis position.Range
getRange()
Gets the axis range.IAxisTick
getTick()
Gets the axis tick.ITitle
getTitle()
Gets the axis title.boolean
isCategoryEnabled()
Gets the state indicating if category is enabled.boolean
isLogScaleEnabled()
Gets the state indicating if log scale is enabled.void
scrollDown()
Scrolls up the axis.void
scrollUp()
Scrolls up the axis.void
setCategorySeries(java.lang.String[] series)
Sets the category series.void
setPosition(IAxis.Position position)
Sets the axis position.void
setRange(Range range)
Sets the axis range.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.
-
-
-
Method Detail
-
getId
int getId()
Gets the axis id.An axis id is automatically assigned when axis is created.
- Returns:
- the axis id
-
getDirection
IAxis.Direction getDirection()
Gets the axis direction.The axis direction is set when axis is created, and won't be changed.
- Returns:
- the axis direction
-
getPosition
IAxis.Position getPosition()
Gets the axis position.- Returns:
- the axis position
-
setPosition
void setPosition(IAxis.Position position)
Sets the axis position.- Parameters:
position
- the axis position
-
setRange
void setRange(Range range)
Sets the axis range.- Parameters:
range
- the axis range
-
getRange
Range getRange()
Gets the axis range.- Returns:
- the axis range
-
getTitle
ITitle getTitle()
Gets the axis title.- Returns:
- the axis title
-
getTick
IAxisTick getTick()
Gets the axis tick.- Returns:
- the axis tick
-
enableLogScale
void enableLogScale(boolean enabled) throws java.lang.IllegalStateException
Enables the log scale. If enabling log scale, stacking trace and category axis will be disabled.- Parameters:
enabled
- true if enabling log scales- Throws:
java.lang.IllegalStateException
- if minimum value of series belonging to this axis is less than zero.
-
isLogScaleEnabled
boolean isLogScaleEnabled()
Gets the state indicating if log scale is enabled.- Returns:
- true if log scale is enabled
-
getGrid
IGrid getGrid()
Gets the grid. The gird interval is identical with the position of axis tick marks. The horizontal grid is accessible from vertical axis, and the vertical grid is accessible from horizontal axis.- Returns:
- grid the grid
-
adjustRange
void adjustRange()
Adjusts the axis range to the series belonging to the axis, so that all series are completely shown.
-
zoomIn
void zoomIn()
Zooms in the axis.
-
zoomIn
void zoomIn(double coordinate)
Zooms in the axis at the given coordinate.- Parameters:
coordinate
- the coordinate
-
zoomOut
void zoomOut()
Zooms out the axis.
-
zoomOut
void zoomOut(double coordinate)
Zooms out the axis at the given coordinate.- Parameters:
coordinate
- the coordinate
-
scrollUp
void scrollUp()
Scrolls up the axis.
-
scrollDown
void scrollDown()
Scrolls up the axis.
-
enableCategory
void enableCategory(boolean enabled)
Enables category. Category is applicable only for X axis. If enabling category, log scale will be disabled. If category series are not yet set, category won't be enabled.- Parameters:
enabled
- true if enabling category
-
isCategoryEnabled
boolean isCategoryEnabled()
Gets the state indicating if category is enabled.- Returns:
- true if category is enabled
-
setCategorySeries
void setCategorySeries(java.lang.String[] series)
Sets the category series. In order to enable category series, enableCategoryAxis(true) has to be invoked.- Parameters:
series
- the category series
-
getCategorySeries
java.lang.String[] getCategorySeries()
Gets the category series. If the category series haven't been set yet, null will be returned.- Returns:
- the category series
-
getPixelCoordinate
int getPixelCoordinate(double dataCoordinate)
Gets the pixel coordinate corresponding to the given data coordinate.- Parameters:
dataCoordinate
- the data coordinate- Returns:
- the pixel coordinate on plot area
-
getDataCoordinate
double getDataCoordinate(int pixelCoordinate)
Gets the data coordinate corresponding to the given pixel coordinate on plot area.- Parameters:
pixelCoordinate
- the pixel coordinate on plot area- Returns:
- the data coordinate
-
addDisposeListener
void addDisposeListener(IDisposeListener listener)
Adds the dispose listener. The newly created color or font for axis can be disposed with the dispose listener when they are no longer needed.- Parameters:
listener
- the dispose listener
-
-