public final class NumberAxis extends ValueAxis<java.lang.Number>
Type | Property and Description |
---|---|
BooleanProperty |
forceZeroInRange
When true zero is always included in the visible range.
|
DoubleProperty |
tickUnit
The value between each major tick mark in data units.
|
lowerBoundProperty, minorTickCountProperty, minorTickLengthProperty, minorTickVisibleProperty, scaleProperty, tickLabelFormatterProperty, upperBoundProperty
animatedProperty, autoRangingProperty, labelProperty, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty
Modifier and Type | Class and Description |
---|---|
static class |
NumberAxis.DefaultFormatter
Default number formatter for NumberAxis, this stays in sync with auto-ranging and formats values appropriately.
|
private static class |
NumberAxis.StyleableProperties |
Axis.TickMark<T>
Modifier and Type | Field and Description |
---|---|
private ChartLayoutAnimator |
animator |
private java.lang.Object |
currentAnimationID |
private StringProperty |
currentFormatterProperty |
private NumberAxis.DefaultFormatter |
defaultFormatter |
private BooleanProperty |
forceZeroInRange
When true zero is always included in the visible range.
|
private DoubleProperty |
tickUnit
The value between each major tick mark in data units.
|
currentLowerBound, dataMaxValue, dataMinValue
measure, measureInvalid, rangeValid, tickLabelsVisibleInvalid
Constructor and Description |
---|
NumberAxis()
Creates an auto-ranging NumberAxis.
|
NumberAxis(double lowerBound,
double upperBound,
double tickUnit)
Creates a non-auto-ranging NumberAxis with the given upper bound, lower bound and tick unit.
|
NumberAxis(java.lang.String axisLabel,
double lowerBound,
double upperBound,
double tickUnit)
Creates a non-auto-ranging NumberAxis with the given lower bound, upper bound and tick unit.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
autoRange(double minValue,
double maxValue,
double length,
double labelSize)
Called to set the upper and lower bound and anything else that needs to be auto-ranged.
|
protected java.util.List<java.lang.Number> |
calculateMinorTickMarks()
Calculates a list of the data values for every minor tick mark
|
protected java.util.List<java.lang.Number> |
calculateTickValues(double length,
java.lang.Object range)
Calculates a list of all the data values for each tick mark in range
|
BooleanProperty |
forceZeroInRangeProperty()
When true zero is always included in the visible range.
|
static java.util.List<<any>> |
getClassCssMetaData() |
java.util.List<<any>> |
getCssMetaData() |
protected java.lang.Object |
getRange()
Called to get the current axis range.
|
protected java.lang.String |
getTickMarkLabel(java.lang.Number value)
Get the string label name for a tick mark with the given value.
|
double |
getTickUnit()
Gets the value of the property tickUnit.
|
boolean |
isForceZeroInRange()
Gets the value of the property forceZeroInRange.
|
private Dimension2D |
measureTickMarkSize(java.lang.Number value,
double rotation,
java.lang.String numFormatter)
Measures the size of the label for a given tick mark value.
|
protected Dimension2D |
measureTickMarkSize(java.lang.Number value,
java.lang.Object range)
Measures the size of the label for a given tick mark value.
|
void |
setForceZeroInRange(boolean value)
Sets the value of the property forceZeroInRange.
|
protected void |
setRange(java.lang.Object range,
boolean animate)
Called to set the current axis range to the given range.
|
void |
setTickUnit(double value)
Sets the value of the property tickUnit.
|
DoubleProperty |
tickUnitProperty()
The value between each major tick mark in data units.
|
autoRange, calculateNewScale, getDisplayPosition, getLowerBound, getMinorTickCount, getMinorTickLength, getScale, getTickLabelFormatter, getUpperBound, getValueForDisplay, getZeroPosition, invalidateRange, isMinorTickVisible, isValueOnAxis, layoutChildren, lowerBoundProperty, minorTickCountProperty, minorTickLengthProperty, minorTickVisibleProperty, scaleProperty, scalePropertyImpl, setLowerBound, setMinorTickCount, setMinorTickLength, setMinorTickVisible, setScale, setTickLabelFormatter, setUpperBound, tickLabelFormatterProperty, tickMarksUpdated, toNumericValue, toRealValue, upperBoundProperty
animatedProperty, autoRangingProperty, computePrefHeight, computePrefWidth, getAnimated, getEffectiveSide, getEffectiveTickLabelRotation, getLabel, getSide, getTickLabelFill, getTickLabelFont, getTickLabelGap, getTickLabelRotation, getTickLength, getTickMarks, invalidateRange, isAutoRanging, isRangeValid, isTickLabelsVisible, isTickMarkVisible, labelProperty, measureTickMarkLabelSize, measureTickMarkSize, requestAxisLayout, requestLayout, setAnimated, setAutoRanging, setEffectiveOrientation, setEffectiveTickLabelRotation, setLabel, setSide, setTickLabelFill, setTickLabelFont, setTickLabelGap, setTickLabelRotation, setTickLabelsVisible, setTickLength, setTickMarkVisible, shouldAnimate, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty
public final BooleanProperty forceZeroInRangeProperty
isForceZeroInRange()
,
setForceZeroInRange(boolean)
public final DoubleProperty tickUnitProperty
getTickUnit()
,
setTickUnit(double)
private java.lang.Object currentAnimationID
private final ChartLayoutAnimator animator
private final StringProperty currentFormatterProperty
private final NumberAxis.DefaultFormatter defaultFormatter
private BooleanProperty forceZeroInRange
private DoubleProperty tickUnit
public NumberAxis()
public NumberAxis(double lowerBound, double upperBound, double tickUnit)
lowerBound
- The lower bound for this axis, i.e. min plottable valueupperBound
- The upper bound for this axis, i.e. max plottable valuetickUnit
- The tick unit, i.e. space between tickmarkspublic NumberAxis(java.lang.String axisLabel, double lowerBound, double upperBound, double tickUnit)
axisLabel
- The name to display for this axislowerBound
- The lower bound for this axis, i.e. min plottable valueupperBound
- The upper bound for this axis, i.e. max plottable valuetickUnit
- The tick unit, i.e. space between tickmarkspublic final boolean isForceZeroInRange()
public final void setForceZeroInRange(boolean value)
public final BooleanProperty forceZeroInRangeProperty()
isForceZeroInRange()
,
setForceZeroInRange(boolean)
public final double getTickUnit()
public final void setTickUnit(double value)
public final DoubleProperty tickUnitProperty()
getTickUnit()
,
setTickUnit(double)
protected java.lang.String getTickMarkLabel(java.lang.Number value)
getTickMarkLabel
in class Axis<java.lang.Number>
value
- The value to format into a tick label stringprotected java.lang.Object getRange()
protected void setRange(java.lang.Object range, boolean animate)
protected java.util.List<java.lang.Number> calculateTickValues(double length, java.lang.Object range)
calculateTickValues
in class Axis<java.lang.Number>
length
- The length of the axis in display unitsrange
- A range object returned from autoRange()protected java.util.List<java.lang.Number> calculateMinorTickMarks()
calculateMinorTickMarks
in class ValueAxis<java.lang.Number>
protected Dimension2D measureTickMarkSize(java.lang.Number value, java.lang.Object range)
measureTickMarkSize
in class Axis<java.lang.Number>
value
- tick mark valuerange
- range to use during calculationsprivate Dimension2D measureTickMarkSize(java.lang.Number value, double rotation, java.lang.String numFormatter)
value
- tick mark valuerotation
- The text rotationnumFormatter
- The number formatterprotected java.lang.Object autoRange(double minValue, double maxValue, double length, double labelSize)
autoRange
in class ValueAxis<java.lang.Number>
minValue
- The min data value that needs to be plotted on this axismaxValue
- The max data value that needs to be plotted on this axislength
- The length of the axis in display coordinateslabelSize
- The approximate average size a label takes along the axispublic static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getCssMetaData()
getCssMetaData
in class ValueAxis<java.lang.Number>