Class TimeAxis
java.lang.Object
com.codename1.ui.chart.axis.Axis
com.codename1.ui.chart.axis.TimeAxis
A time axis whose values are milliseconds since the epoch. Ticks land on calendar
boundaries (whole minutes, midnights, first of the month, new year) and the label
format follows the tick unit, so zooming from years down to milliseconds stays readable.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double[]adjustBounds(double min, double max) Lets a subclass pad or round the automatic bounds; the default rounds a numeric range outward to the nearest nice step so the outermost grid lines sit on the plot edge.protected StringdefaultFormat(double value, double step) The axis' built in formatting; numbers are grouped and localized.protected doubleflatPad(double anchor) One hour each side of a single timestamp, rather than 10% of its epoch milliseconds.double[]ticks(int maxCount) Ticks for the visible range.Methods inherited from class Axis
format, formatNumber, forward, fromNormalized, getDataMax, getDataMin, getFormatter, getPosition, getTitle, getVisibleMax, getVisibleMin, inverse, isGridVisible, isIncludeZero, isMaxFixed, isMinFixed, isVertical, isVisible, isZoomed, isZoomEnabled, pan, resetViewport, restoreViewport, setDataBounds, setDisplayRange, setFormatter, setGridVisible, setIncludeZero, setMaxZoom, setPosition, setRange, setTitle, setVisible, setVisibleRange, setZoomEnabled, toNormalized, zoom
-
Constructor Details
-
TimeAxis
public TimeAxis(int position) Creates a time axis.
Parameters
position: one ofAxis.BOTTOM,Axis.LEFT,Axis.RIGHTorAxis.TOP
-
-
Method Details
-
flatPad
-
adjustBounds
protected double[] adjustBounds(double min, double max) Description copied from class:AxisLets a subclass pad or round the automatic bounds; the default rounds a numeric range outward to the nearest nice step so the outermost grid lines sit on the plot edge.
Parameters
-
min: the raw minimum -
max: the raw maximum
Returns
{min, max}to use- Overrides:
adjustBoundsin classAxis
-
-
ticks
-
defaultFormat
Description copied from class:AxisThe axis' built in formatting; numbers are grouped and localized.- Overrides:
defaultFormatin classAxis
-