public abstract class Axis extends AbstractConfigurationObject
Modifier and Type | Field and Description |
---|---|
protected Number |
max |
protected Number |
min |
static String |
MINOR_TICK_INTERVAL_AUTO |
Constructor and Description |
---|
Axis() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addCategory(String category)
Adds category to the categories array
|
abstract void |
addPlotBand(PlotBand plotBand)
Adds plotBand to the plotBands array
|
abstract void |
addPlotLine(PlotLine plotLine)
Adds plotLine to the plotLines array
|
abstract void |
addUnit(TimeUnitMultiples unit)
Adds unit to the units array
|
abstract Boolean |
getAllowDecimals() |
abstract Boolean |
getAlternateGridColor() |
protected Integer |
getAxisIndex() |
abstract String[] |
getCategories() |
abstract Number |
getCeiling() |
abstract String |
getClassName() |
ChartConfiguration |
getConfiguration()
Returns the configuration this axis is bound to.
|
abstract Crosshair |
getCrosshair() |
abstract DateTimeLabelFormats |
getDateTimeLabelFormats() |
abstract String |
getDescription() |
abstract Boolean |
getEndOnTick() |
abstract Number |
getFloor() |
abstract Number |
getGridZIndex() |
abstract String |
getId() |
abstract Labels |
getLabels() |
abstract Number |
getLinkedTo() |
Number |
getMax() |
abstract Number |
getMaxPadding() |
Number |
getMin() |
abstract String |
getMinorTickInterval() |
abstract Number |
getMinorTickLength() |
abstract TickPosition |
getMinorTickPosition() |
abstract Number |
getMinPadding() |
abstract Number |
getMinRange() |
abstract Number |
getMinTickInterval() |
abstract Number |
getOffset() |
abstract Boolean |
getOpposite() |
abstract PlotBand[] |
getPlotBands() |
abstract PlotLine[] |
getPlotLines() |
abstract Boolean |
getReversed() |
abstract Boolean |
getShowEmpty() |
abstract Boolean |
getShowFirstLabel() |
abstract Boolean |
getShowLastLabel() |
abstract Number |
getSoftMax() |
abstract Number |
getSoftMin() |
abstract Number |
getStartOfWeek() |
abstract Boolean |
getStartOnTick() |
abstract Number |
getTickAmount() |
abstract Number |
getTickInterval() |
abstract Number |
getTickLength() |
abstract TickmarkPlacement |
getTickmarkPlacement() |
abstract Number |
getTickPixelInterval() |
abstract TickPosition |
getTickPosition() |
abstract Number[] |
getTickPositions() |
abstract AxisTitle |
getTitle() |
abstract AxisType |
getType() |
abstract Boolean |
getUniqueNames() |
abstract TimeUnitMultiples[] |
getUnits() |
abstract Boolean |
getVisible() |
abstract void |
removeCategory(String category)
Removes first occurrence of category in categories array
|
abstract void |
removePlotBand(PlotBand plotBand)
Removes first occurrence of plotBand in plotBands array
|
abstract void |
removePlotLine(PlotLine plotLine)
Removes first occurrence of plotLine in plotLines array
|
abstract void |
removeUnit(TimeUnitMultiples unit)
Removes first occurrence of unit in units array
|
abstract void |
setAllowDecimals(Boolean allowDecimals)
Whether to allow decimals in this axis' ticks.
|
abstract void |
setAlternateGridColor(Boolean alternateGridColor)
When using an alternate grid color, a band is painted across the plot
area between every other grid line.
|
void |
setAxisIndex(int i) |
abstract void |
setCategories(String... categories)
If categories are present for the axis, names are used instead of
numbers for that axis.
|
abstract void |
setCeiling(Number ceiling)
The highest allowed value for automatically computed axis extremes.
|
abstract void |
setClassName(String className)
A class name that opens for styling the axis by CSS.
|
void |
setConfiguration(ChartConfiguration configuration)
Sets the configuration this axis is bound to.
|
abstract void |
setCrosshair(Crosshair crosshair)
Configure a crosshair that follows either the mouse pointer or the
hovered point.
|
abstract void |
setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
For a datetime axis, the scale will automatically adjust to the
appropriate unit.
|
abstract void |
setDescription(String description)
Description of the axis to screen reader users.
|
abstract void |
setEndOnTick(Boolean endOnTick)
Whether to force the axis to end on a tick.
|
void |
setExtremes(Date min,
Date max)
The minimum and maximum value of the axis as Date.
|
void |
setExtremes(Date min,
Date max,
boolean redraw)
The minimum and maximum value of the axis as Date.
|
void |
setExtremes(Date minimum,
Date maximum,
boolean redraw,
boolean animate)
The minimum and maximum value of the axis as Date.
|
void |
setExtremes(Number min,
Number max)
Sets the minimum and maximum of the axes after rendering has finished.
|
void |
setExtremes(Number min,
Number max,
boolean redraw)
Sets the extremes at runtime.
|
void |
setExtremes(Number minimum,
Number maximum,
boolean redraw,
boolean animate)
Run-time modification of the axis extremes.
|
abstract void |
setFloor(Number floor)
The lowest allowed value for automatically computed axis extremes.
|
abstract void |
setGridZIndex(Number gridZIndex)
The Z index of the grid lines.
|
abstract void |
setId(String id)
An id for the axis.
|
abstract void |
setLabels(Labels labels)
The axis labels show the number or category for each tick.
|
abstract void |
setLinkedTo(Number linkedTo)
Index of another axis that this axis is linked to.
|
void |
setMax(Date max)
The maximum value of the axis as Date.
|
void |
setMax(Number max)
The maximum value of the axis.
|
abstract void |
setMaxPadding(Number maxPadding)
Padding of the max value relative to the length of the axis.
|
void |
setMin(Date min)
The minimum value of the axis as Date.
|
void |
setMin(Number min)
The minimum value of the axis.
|
abstract void |
setMinorTickInterval(String minorTickInterval)
Tick interval in scale units for the minor ticks.
|
abstract void |
setMinorTickLength(Number minorTickLength)
The pixel length of the minor tick marks.
|
abstract void |
setMinorTickPosition(TickPosition minorTickPosition)
The position of the minor tick marks relative to the axis line.
|
abstract void |
setMinPadding(Number minPadding)
Padding of the min value relative to the length of the axis.
|
abstract void |
setMinRange(Number minRange)
The minimum range to display on this axis.
|
abstract void |
setMinTickInterval(Number minTickInterval)
The minimum tick interval allowed in axis values.
|
abstract void |
setOffset(Number offset)
The distance in pixels from the plot area to the axis line.
|
abstract void |
setOpposite(Boolean opposite)
Whether to display the axis on the opposite side of the normal.
|
abstract void |
setPlotBands(PlotBand... plotBands)
An array of colored bands stretching across the plot area marking an
interval on the axis.
|
abstract void |
setPlotLines(PlotLine... plotLines)
An array of lines stretching across the plot area, marking a specific
value on one of the axes.
|
abstract void |
setReversed(Boolean reversed)
Whether to reverse the axis so that the highest number is closest to the
origin.
|
abstract void |
setShowEmpty(Boolean showEmpty)
Whether to show the axis line and title when the axis has no data.
|
abstract void |
setShowFirstLabel(Boolean showFirstLabel)
Whether to show the first tick label.
|
abstract void |
setShowLastLabel(Boolean showLastLabel)
Whether to show the last tick label.
|
abstract void |
setSoftMax(Number softMax)
A soft maximum for the axis.
|
abstract void |
setSoftMin(Number softMin)
A soft minimum for the axis.
|
abstract void |
setStartOfWeek(Number startOfWeek)
For datetime axes, this decides where to put the tick between weeks.
|
abstract void |
setStartOnTick(Boolean startOnTick)
Whether to force the axis to start on a tick.
|
abstract void |
setTickAmount(Number tickAmount)
The amount of ticks to draw on the axis.
|
abstract void |
setTickInterval(Number tickInterval)
The interval of the tick marks in axis units.
|
abstract void |
setTickLength(Number tickLength)
The pixel length of the main tick marks.
|
abstract void |
setTickmarkPlacement(TickmarkPlacement tickmarkPlacement)
For categorized axes only.
|
abstract void |
setTickPixelInterval(Number tickPixelInterval)
If tickInterval is
null this option sets the approximate
pixel interval of the tick marks. |
abstract void |
setTickPosition(TickPosition tickPosition)
The position of the major tick marks relative to the axis line.
|
abstract void |
setTickPositions(Number[] tickPositions)
An array defining where the ticks are laid out on the axis.
|
abstract void |
setTitle(AxisTitle title)
The axis title, showing next to the axis line.
|
abstract void |
setTitle(String title) |
abstract void |
setType(AxisType type)
The type of axis.
|
abstract void |
setUniqueNames(Boolean uniqueNames)
Applies only when the axis
type is category . |
abstract void |
setUnits(TimeUnitMultiples... units)
Datetime axis only.
|
abstract void |
setVisible(Boolean visible)
Whether axis, including axis title, line, ticks and labels, should be
visible.
|
public static final String MINOR_TICK_INTERVAL_AUTO
protected Number min
protected Number max
public void setAxisIndex(int i)
protected Integer getAxisIndex()
public Number getMin()
setMin(Number)
public void setMin(Number min)
min
- public void setMin(Date min)
min
- setMin(Number)
public Number getMax()
setMax(Number)
public void setMax(Number max)
max
- public void setMax(Date max)
max
- setMax(Number)
public void setExtremes(Number min, Number max)
min
- The new minimum valuemax
- The new maximum valuepublic void setExtremes(Date min, Date max)
setExtremes(Number, Number)
public void setExtremes(Number min, Number max, boolean redraw)
min
- Minimum.max
- Maximum.redraw
- Whether or not to redraw the chart.public void setExtremes(Date min, Date max, boolean redraw)
setExtremes(Number, Number, boolean)
public void setExtremes(Number minimum, Number maximum, boolean redraw, boolean animate)
minimum
- New minimum value.maximum
- New maximum value.redraw
- Whether or not to redraw the chart.animate
- Whether or not to animate the rescaling.public void setExtremes(Date minimum, Date maximum, boolean redraw, boolean animate)
public ChartConfiguration getConfiguration()
public void setConfiguration(ChartConfiguration configuration)
configuration
- Configuration this object is linked to.public abstract Boolean getAllowDecimals()
setAllowDecimals(Boolean)
public abstract void setAllowDecimals(Boolean allowDecimals)
public abstract Boolean getAlternateGridColor()
#setAlternateGridColor(Color)
public abstract void setAlternateGridColor(Boolean alternateGridColor)
public abstract String[] getCategories()
setCategories(String...)
public abstract void setCategories(String... categories)
If categories are present for the axis, names are used instead of
numbers for that axis. Since Highcharts 3.0, categories can also be
extracted by giving each point a name
and
setting axis type to category
.
However, if you have multiple series, best practice remains defining the
categories
array.
Example:
categories: ['Apples', 'Bananas', 'Oranges']
public abstract void addCategory(String category)
category
- to addsetCategories(String...)
public abstract void removeCategory(String category)
category
- to removesetCategories(String...)
public abstract Number getCeiling()
setCeiling(Number)
public abstract void setCeiling(Number ceiling)
public abstract String getClassName()
setClassName(String)
public abstract void setClassName(String className)
public abstract Crosshair getCrosshair()
setCrosshair(Crosshair)
public abstract void setCrosshair(Crosshair crosshair)
public abstract DateTimeLabelFormats getDateTimeLabelFormats()
public abstract void setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
public abstract String getDescription()
setDescription(String)
public abstract void setDescription(String description)
public abstract Boolean getEndOnTick()
setEndOnTick(Boolean)
public abstract void setEndOnTick(Boolean endOnTick)
maxPadding
option to control the axis end.public abstract Number getFloor()
setFloor(Number)
public abstract void setFloor(Number floor)
public abstract Number getGridZIndex()
setGridZIndex(Number)
public abstract void setGridZIndex(Number gridZIndex)
public abstract String getId()
setId(String)
public abstract void setId(String id)
chart.get()
.public abstract Labels getLabels()
setLabels(Labels)
public abstract void setLabels(Labels labels)
public abstract Number getLinkedTo()
setLinkedTo(Number)
public abstract void setLinkedTo(Number linkedTo)
public abstract Number getMaxPadding()
setMaxPadding(Number)
public abstract void setMaxPadding(Number maxPadding)
max
option is set or a max extreme is set using
axis.setExtremes()
, the maxPadding will be ignored.public abstract Number getMinPadding()
setMinPadding(Number)
public abstract void setMinPadding(Number minPadding)
min
option is set or a min extreme is set using
axis.setExtremes()
, the minPadding will be ignored.public abstract Number getMinRange()
setMinRange(Number)
public abstract void setMinRange(Number minRange)
The minimum range to display on this axis. The entire axis will not be allowed to span over a smaller interval than this. For example, for a datetime axis the main unit is milliseconds. If minRange is set to 3600000, you can't zoom in more than to one hour.
The default minRange for the x axis is five times the smallest interval between any of the data points.
On a logarithmic axis, the unit for the minimum range is the power. So a minRange of 1 means that the axis can be zoomed to 10-100, 100-1000, 1000-10000 etc.
Note that the minPadding
, maxPadding
,
startOnTick
and endOnTick
settings also affect
how the extremes of the axis are computed.
public abstract Number getMinTickInterval()
setMinTickInterval(Number)
public abstract void setMinTickInterval(Number minTickInterval)
public abstract String getMinorTickInterval()
setMinorTickInterval(String)
public abstract void setMinorTickInterval(String minorTickInterval)
Tick interval in scale units for the minor ticks. On a linear axis, if
"auto"
, the minor tick interval is calculated as a fifth of
the tickInterval. If null
, minor ticks are not shown.
On logarithmic axes, the unit is the power of the value. For example, setting the minorTickInterval to 1 puts one tick on each of 0.1, 1, 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks between 1 and 10, 10 and 100 etc. A minorTickInterval of "auto" on a log axis results in a best guess, attempting to enter approximately 5 minor ticks between each major tick.
If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent performance problems.
On axes using categories
, minor ticks are
not supported.
public abstract Number getMinorTickLength()
setMinorTickLength(Number)
public abstract void setMinorTickLength(Number minorTickLength)
public abstract TickPosition getMinorTickPosition()
setMinorTickPosition(TickPosition)
public abstract void setMinorTickPosition(TickPosition minorTickPosition)
inside
and outside
.public abstract Number getOffset()
setOffset(Number)
public abstract void setOffset(Number offset)
public abstract Boolean getOpposite()
setOpposite(Boolean)
public abstract void setOpposite(Boolean opposite)
public abstract PlotBand[] getPlotBands()
setPlotBands(PlotBand...)
public abstract void setPlotBands(PlotBand... plotBands)
An array of colored bands stretching across the plot area marking an interval on the axis.
public abstract void addPlotBand(PlotBand plotBand)
plotBand
- to addsetPlotBands(PlotBand...)
public abstract void removePlotBand(PlotBand plotBand)
plotBand
- to removesetPlotBands(PlotBand...)
public abstract PlotLine[] getPlotLines()
setPlotLines(PlotLine...)
public abstract void setPlotLines(PlotLine... plotLines)
public abstract void addPlotLine(PlotLine plotLine)
plotLine
- to addsetPlotLines(PlotLine...)
public abstract void removePlotLine(PlotLine plotLine)
plotLine
- to removesetPlotLines(PlotLine...)
public abstract Boolean getReversed()
setReversed(Boolean)
public abstract void setReversed(Boolean reversed)
public abstract Boolean getShowEmpty()
setShowEmpty(Boolean)
public abstract void setShowEmpty(Boolean showEmpty)
public abstract Boolean getShowFirstLabel()
setShowFirstLabel(Boolean)
public abstract void setShowFirstLabel(Boolean showFirstLabel)
public abstract Boolean getShowLastLabel()
setShowLastLabel(Boolean)
public abstract void setShowLastLabel(Boolean showLastLabel)
public abstract Number getSoftMax()
setSoftMax(Number)
public abstract void setSoftMax(Number softMax)
public abstract Number getSoftMin()
setSoftMin(Number)
public abstract void setSoftMin(Number softMin)
public abstract Number getStartOfWeek()
setStartOfWeek(Number)
public abstract void setStartOfWeek(Number startOfWeek)
public abstract Boolean getStartOnTick()
setStartOnTick(Boolean)
public abstract void setStartOnTick(Boolean startOnTick)
minPadding
option to control the axis start.public abstract Number getTickAmount()
setTickAmount(Number)
public abstract void setTickAmount(Number tickAmount)
The amount of ticks to draw on the axis. This opens up for aligning the
ticks of multiple charts or panes within a chart. This option overrides
the tickPixelInterval
option.
This option only has an effect on linear axes. Datetime, logarithmic or category axes are not affected.
public abstract Number getTickInterval()
setTickInterval(Number)
public abstract void setTickInterval(Number tickInterval)
The interval of the tick marks in axis units. When null
, the
tick interval is computed to approximately follow the
tickPixelInterval
on linear and
datetime axes. On categorized axes, a null
tickInterval will
default to 1, one category. Note that datetime axes are based on
milliseconds, so for example an interval of one day is expressed as
24 * 3600 * 1000
.
On logarithmic axes, the tickInterval is based on powers, so a tickInterval of 1 means one tick on each of 0.1, 1, 10, 100 etc. A tickInterval of 2 means a tick of 0.1, 10, 1000 etc. A tickInterval of 0.2 puts a tick on 0.1, 0.2, 0.4, 0.6, 0.8, 1, 2, 4, 6, 8, 10, 20, 40 etc.
If the tickInterval is too dense for labels to be drawn, Highcharts may remove ticks.
public abstract Number getTickLength()
setTickLength(Number)
public abstract void setTickLength(Number tickLength)
public abstract Number getTickPixelInterval()
setTickPixelInterval(Number)
public abstract void setTickPixelInterval(Number tickPixelInterval)
null
this option sets the approximate
pixel interval of the tick marks. Not applicable to categorized axis.public abstract TickPosition getTickPosition()
setTickPosition(TickPosition)
public abstract void setTickPosition(TickPosition tickPosition)
inside
and outside
.public abstract Number[] getTickPositions()
setTickPositions(Number[])
public abstract void setTickPositions(Number[] tickPositions)
tickPixelInterval
and
tickInterval
.public abstract TickmarkPlacement getTickmarkPlacement()
setTickmarkPlacement(TickmarkPlacement)
public abstract void setTickmarkPlacement(TickmarkPlacement tickmarkPlacement)
on
the tick mark is placed in
the center of the category, if between
the tick mark is
placed between categories. The default is between
if the
tickInterval
is 1, else on
.public abstract AxisTitle getTitle()
setTitle(AxisTitle)
public abstract void setTitle(AxisTitle title)
public abstract AxisType getType()
setType(AxisType)
public abstract void setType(AxisType type)
"linear"
,
"logarithmic"
, "datetime"
or
"category"
. In a datetime axis, the numbers are given in
milliseconds, and tick marks are placed on appropriate values like full
hours or days. In a category axis, the point
names of the chart's series are used for categories, if not a
categories array is defined.public abstract Boolean getUniqueNames()
setUniqueNames(Boolean)
public abstract void setUniqueNames(Boolean uniqueNames)
type
is category
.
When uniqueNames
is true, points are placed on the X axis
according to their names. If the same point name is repeated in the same
or another series, the point is placed on the same X position as other
points of the same name. When uniqueNames
is false, the
points are laid out in increasing X positions regardless of their names,
and the X axis category will take the name of the last point in each
position.public abstract TimeUnitMultiples[] getUnits()
setUnits(TimeUnitMultiples...)
public abstract void setUnits(TimeUnitMultiples... units)
public abstract void addUnit(TimeUnitMultiples unit)
unit
- to addsetUnits(TimeUnitMultiples...)
public abstract void removeUnit(TimeUnitMultiples unit)
unit
- to removesetUnits(TimeUnitMultiples...)
public abstract Boolean getVisible()
setVisible(Boolean)
public abstract void setVisible(Boolean visible)
public abstract void setTitle(String title)
Copyright © 2020. All rights reserved.