APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.scene.chart

public abstract Class ValueAxis<T extends Number>

extends Axis<T extends Number>
Class Inheritance
Known Direct Subclasses
javafx.scene.chart.NumberAxis
Type Parameters
<T>
the axis value type
Imports
javafx.css.CssMetaData, .StyleableBooleanProperty, .StyleableDoubleProperty, .StyleableIntegerProperty, .Styleable, .StyleableProperty, javafx.css.converter.BooleanConverter, .SizeConverter, java.util.ArrayList, .Collections, .List, javafx.beans.property.*, javafx.geometry.Side, javafx.scene.shape.LineTo, .MoveTo, .Path, javafx.util.StringConverter

An axis whose data is defined as Numbers. It can also draw minor tick-marks between the major ones.
Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected final DoubleProperty
currentLowerBound

The current value for the lowerBound of this axis (minimum value).

pack-priv double
dataMaxValue

This is the maximum current data value and it is used while auto ranging.

pack-priv double
dataMinValue

This is the minimum current data value and it is used while auto ranging.

private DoubleProperty
lowerBound

The value for the lower bound of this axis (minimum value).

private IntegerProperty
minorTickCount

The number of minor tick divisions to be displayed between each major tick mark.

private DoubleProperty
minorTickLength

The length of minor tick mark lines.

private boolean
private List<T>
minorTickMarkValues

List of the values at which there are minor ticks

private final Path
private BooleanProperty
minorTickVisible

true if minor tick marks should be displayed

private double
private ReadOnlyDoubleWrapper
scale

The scale factor from data units to visual units

private final ObjectProperty<StringConverter<T>>
tickLabelFormatter

StringConverter used to format tick mark labels.

private DoubleProperty
upperBound

The value for the upper bound of this axis (maximum value).

Inherited from javafx.scene.chart.Axis:
measuremeasureInvalidrangeValidtickLabelsVisibleInvalid

Constructor Summary

AccessConstructor and Description
public
ValueAxis()

Creates a auto-ranging ValueAxis.

public
ValueAxis(double
The lower bound for this axis, i.e. min plottable value
lowerBound
,
double
The upper bound for this axis, i.e. max plottable value
upperBound
)

Creates a non-auto-ranging ValueAxis with the given lower and upper bound.

Method Summary

Modifier and TypeMethod and Description
protected final Object

Returns:

Range information, this is implementation dependent
autoRange
(double
The length of the axis in screen coordinates
length
)

Implements abstract javafx.scene.chart.Axis.autoRange.

This calculates the upper and lower bound based on the data provided to invalidateRange() method.

protected Object

Returns:

The calculated range
autoRange
(double
The min data value that needs to be plotted on this axis
minValue
,
double
The max data value that needs to be plotted on this axis
maxValue
,
double
The length of the axis in display coordinates
length
,
double
The approximate average size a label takes along the axis
labelSize
)

Called to set the upper and lower bound and anything else that needs to be auto-ranged.

protected abstract List<T>

Returns:

List of data values where to draw minor tick marks
calculateMinorTickMarks
()

Calculates a list of the data values for every minor tick mark

protected final double

Returns:

new scale to fit the range from lower bound to upper bound in the given display length
calculateNewScale
(double
The display length of the axis
length
,
double
The lower bound value
lowerBound
,
double
The upper bound value
upperBound
)

Calculates new scale for this axis.

public static List<CssMetaData<? extends Styleable, ?>>

Returns:

the CssMetaData
getClassCssMetaData
()

Hides javafx.scene.chart.Axis.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Overrides javafx.scene.chart.Axis.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

public double

Returns:

display position
getDisplayPosition
(T
The data value to work out display position for
value
)

Implements abstract javafx.scene.chart.Axis.getDisplayPosition.

Gets the display position along this axis for a given value.

public final double
public final int
public final double
public final double
public final StringConverter<T>
public final double
public T

Returns:

the nearest data value to the given pixel position or null if not on axis;
getValueForDisplay
(double
A pixel position on this axis
displayPosition
)

Implements abstract javafx.scene.chart.Axis.getValueForDisplay.

Gets the data value for the given display position on this axis.

public double

Returns:

display position or Double.NaN if zero is not in current range;
getZeroPosition
()

Implements abstract javafx.scene.chart.Axis.getZeroPosition.

Gets the display position of the zero line along this axis.

public void
invalidateRange(List<T>
The current set of all data that needs to be plotted on this axis
data
)

Overrides javafx.scene.chart.Axis.invalidateRange.

Called when the data has changed and the range may not be valid anymore.

public final boolean
public boolean

Returns:

true if the given value is plottable on this axis
isValueOnAxis
(T
The value to check if its on axis
value
)

Implements abstract javafx.scene.chart.Axis.isValueOnAxis.

Checks if the given value is plottable on this axis

protected void
layoutChildren()

Overrides javafx.scene.chart.Axis.layoutChildren.

Invoked during the layout pass to layout this axis and all its content.

public final DoubleProperty
public final IntegerProperty
public final DoubleProperty
public final BooleanProperty
public final ReadOnlyDoubleProperty
pack-priv ReadOnlyDoubleWrapper
public final void
setLowerBound(double value)

public final void
setMinorTickCount(int value)

public final void
setMinorTickLength(double value)

public final void
setMinorTickVisible(boolean value)

protected final void
setScale(double scale)

public final void
public final void
setUpperBound(double value)

public final ObjectProperty<StringConverter<T>>
protected void
tickMarksUpdated()

Overrides javafx.scene.chart.Axis.tickMarksUpdated.

Called during layout if the tickmarks have been updated, allowing subclasses to do anything they need to in reaction.

public double

Returns:

Numeric value for the given data value
toNumericValue
(T
The data value to convert
value
)

Implements abstract javafx.scene.chart.Axis.toNumericValue.

All axis values must be representable by some numeric value.

public T

Returns:

Data value for given numeric value
toRealValue
(double
The numeric value to convert
value
)

Implements abstract javafx.scene.chart.Axis.toRealValue.

All axis values must be representable by some numeric value.

private void
updateMinorTickPath(Side side, double length)

public final DoubleProperty
Inherited from javafx.scene.chart.Axis:
animatedPropertyautoRangingPropertycalculateTickValuescomputePrefHeightcomputePrefWidthgetAnimatedgetEffectiveSidegetEffectiveTickLabelRotationgetLabelgetRangegetSidegetTickLabelFillgetTickLabelFontgetTickLabelGapgetTickLabelRotationgetTickLengthgetTickMarkLabelgetTickMarksinvalidateRangeisAutoRangingisRangeValidisTickLabelsVisibleisTickMarkVisiblelabelPropertymeasureTickMarkLabelSizemeasureTickMarkSizemeasureTickMarkSizerequestAxisLayoutrequestLayoutsetAnimatedsetAutoRangingsetEffectiveOrientationsetEffectiveTickLabelRotationsetLabelsetRangesetSidesetTickLabelFillsetTickLabelFontsetTickLabelGapsetTickLabelRotationsetTickLabelsVisiblesetTickLengthsetTickMarkVisibleshouldAnimatesidePropertytickLabelFillPropertytickLabelFontPropertytickLabelGapPropertytickLabelRotationPropertytickLabelsVisiblePropertytickLengthPropertytickMarkVisibleProperty

Field Detail

currentLowerBoundback to summary
protected final DoubleProperty currentLowerBound

The current value for the lowerBound of this axis (minimum value). This may be the same as lowerBound or different. It is used by NumberAxis to animate the lowerBound from the old value to the new value.

dataMaxValueback to summary
pack-priv double dataMaxValue

This is the maximum current data value and it is used while auto ranging. Package private solely for test purposes

dataMinValueback to summary
pack-priv double dataMinValue

This is the minimum current data value and it is used while auto ranging. Package private solely for test purposes

lowerBoundback to summary
private DoubleProperty lowerBound

The value for the lower bound of this axis (minimum value). This is automatically set if auto ranging is on.

minorTickCountback to summary
private IntegerProperty minorTickCount

The number of minor tick divisions to be displayed between each major tick mark. The number of actual minor tick marks will be one less than this.

minorTickLengthback to summary
private DoubleProperty minorTickLength

The length of minor tick mark lines. Set to 0 to not display minor tick marks.

minorTickMarksDirtyback to summary
private boolean minorTickMarksDirty
minorTickMarkValuesback to summary
private List<T> minorTickMarkValues

List of the values at which there are minor ticks

minorTickPathback to summary
private final Path minorTickPath
minorTickVisibleback to summary
private BooleanProperty minorTickVisible

true if minor tick marks should be displayed

offsetback to summary
private double offset
scaleback to summary
private ReadOnlyDoubleWrapper scale

The scale factor from data units to visual units

tickLabelFormatterback to summary
private final ObjectProperty<StringConverter<T>> tickLabelFormatter

StringConverter used to format tick mark labels. If null a default will be used

upperBoundback to summary
private DoubleProperty upperBound

The value for the upper bound of this axis (maximum value). This is automatically set if auto ranging is on.

Constructor Detail

ValueAxisback to summary
public ValueAxis()

Creates a auto-ranging ValueAxis.

ValueAxisback to summary
public ValueAxis(double lowerBound, double upperBound)

Creates a non-auto-ranging ValueAxis with the given lower and upper bound.

Parameters
lowerBound:double

The lower bound for this axis, i.e. min plottable value

upperBound:double

The upper bound for this axis, i.e. max plottable value

Method Detail

autoRangeback to summary
protected final Object autoRange(double length)

Implements abstract javafx.scene.chart.Axis.autoRange.

This calculates the upper and lower bound based on the data provided to invalidateRange() method. This must not affect the state of the axis. Any results of the auto-ranging should be returned in the range object. This will we passed to setRange() if it has been decided to adopt this range for this axis.

Parameters
length:double

The length of the axis in screen coordinates

Returns:Object

Range information, this is implementation dependent

Annotations
@Override
autoRangeback to summary
protected 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. This must not affect the state of the axis. Any results of the auto-ranging should be returned in the range object. This will we passed to setRange() if it has been decided to adopt this range for this axis.

Parameters
minValue:double

The min data value that needs to be plotted on this axis

maxValue:double

The max data value that needs to be plotted on this axis

length:double

The length of the axis in display coordinates

labelSize:double

The approximate average size a label takes along the axis

Returns:Object

The calculated range

calculateMinorTickMarksback to summary
protected abstract List<T> calculateMinorTickMarks()

Calculates a list of the data values for every minor tick mark

Returns:List<T>

List of data values where to draw minor tick marks

calculateNewScaleback to summary
protected final double calculateNewScale(double length, double lowerBound, double upperBound)

Calculates new scale for this axis. This should not affect any properties of this axis.

Parameters
length:double

The display length of the axis

lowerBound:double

The lower bound value

upperBound:double

The upper bound value

Returns:double

new scale to fit the range from lower bound to upper bound in the given display length

getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.chart.Axis.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

Returns:List<CssMetaData<? extends Styleable, ?>>

the CssMetaData

Since
JavaFX 8.0
getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.chart.Axis.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.scene.chart.Axis.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

Annotations
@Override
Since
JavaFX 8.0
getDisplayPositionback to summary
public double getDisplayPosition(T value)

Implements abstract javafx.scene.chart.Axis.getDisplayPosition.

Gets the display position along this axis for a given value. If the value is not in the current range, the returned value will be an extrapolation of the display position.

Parameters
value:T

The data value to work out display position for

Returns:double

display position

Annotations
@Override
getLowerBoundback to summary
public final double getLowerBound()
getMinorTickCountback to summary
public final int getMinorTickCount()
getMinorTickLengthback to summary
public final double getMinorTickLength()
getScaleback to summary
public final double getScale()
getTickLabelFormatterback to summary
public final StringConverter<T> getTickLabelFormatter()
getUpperBoundback to summary
public final double getUpperBound()
getValueForDisplayback to summary
public T getValueForDisplay(double displayPosition)

Implements abstract javafx.scene.chart.Axis.getValueForDisplay.

Gets the data value for the given display position on this axis. If the axis is a CategoryAxis this will be the nearest value.

Parameters
displayPosition:double

A pixel position on this axis

Returns:T

the nearest data value to the given pixel position or null if not on axis;

Annotations
@Override
getZeroPositionback to summary
public double getZeroPosition()

Implements abstract javafx.scene.chart.Axis.getZeroPosition.

Gets the display position of the zero line along this axis.

Returns:double

display position or Double.NaN if zero is not in current range;

Annotations
@Override
invalidateRangeback to summary
public void invalidateRange(List<T> data)

Overrides javafx.scene.chart.Axis.invalidateRange.

Called when the data has changed and the range may not be valid anymore. This is only called by the chart if isAutoRanging() returns true. If we are auto ranging it will cause layout to be requested and auto ranging to happen on next layout pass.

Parameters
data:List<T>

The current set of all data that needs to be plotted on this axis

Annotations
@Override
isMinorTickVisibleback to summary
public final boolean isMinorTickVisible()
isValueOnAxisback to summary
public boolean isValueOnAxis(T value)

Implements abstract javafx.scene.chart.Axis.isValueOnAxis.

Checks if the given value is plottable on this axis

Parameters
value:T

The value to check if its on axis

Returns:boolean

true if the given value is plottable on this axis

Annotations
@Override
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.chart.Axis.layoutChildren.

Invoked during the layout pass to layout this axis and all its content.

Annotations
@Override
lowerBoundPropertyback to summary
public final DoubleProperty lowerBoundProperty()
minorTickCountPropertyback to summary
public final IntegerProperty minorTickCountProperty()
minorTickLengthPropertyback to summary
public final DoubleProperty minorTickLengthProperty()
minorTickVisiblePropertyback to summary
public final BooleanProperty minorTickVisibleProperty()
scalePropertyback to summary
public final ReadOnlyDoubleProperty scaleProperty()
scalePropertyImplback to summary
pack-priv ReadOnlyDoubleWrapper scalePropertyImpl()
setLowerBoundback to summary
public final void setLowerBound(double value)
setMinorTickCountback to summary
public final void setMinorTickCount(int value)
setMinorTickLengthback to summary
public final void setMinorTickLength(double value)
setMinorTickVisibleback to summary
public final void setMinorTickVisible(boolean value)
setScaleback to summary
protected final void setScale(double scale)
setTickLabelFormatterback to summary
public final void setTickLabelFormatter(StringConverter<T> value)
setUpperBoundback to summary
public final void setUpperBound(double value)
tickLabelFormatterPropertyback to summary
public final ObjectProperty<StringConverter<T>> tickLabelFormatterProperty()
tickMarksUpdatedback to summary
protected void tickMarksUpdated()

Overrides javafx.scene.chart.Axis.tickMarksUpdated.

Called during layout if the tickmarks have been updated, allowing subclasses to do anything they need to in reaction.

Annotations
@Override
toNumericValueback to summary
public double toNumericValue(T value)

Implements abstract javafx.scene.chart.Axis.toNumericValue.

All axis values must be representable by some numeric value. This gets the numeric value for a given data value.

Parameters
value:T

The data value to convert

Returns:double

Numeric value for the given data value

Annotations
@Override
toRealValueback to summary
public T toRealValue(double value)

Implements abstract javafx.scene.chart.Axis.toRealValue.

All axis values must be representable by some numeric value. This gets the data value for a given numeric value.

Parameters
value:double

The numeric value to convert

Returns:T

Data value for given numeric value

Annotations
@Override
updateMinorTickPathback to summary
private void updateMinorTickPath(Side side, double length)
upperBoundPropertyback to summary
public final DoubleProperty upperBoundProperty()
javafx.scene.chart back to summary

private Class ValueAxis.StyleableProperties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<ValueAxis<? extends Number>, Number>
private static final CssMetaData<ValueAxis<? extends Number>, Number>
private static final CssMetaData<ValueAxis<? extends Number>, Boolean>
private static final List<CssMetaData<? extends Styleable, ?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MINOR_TICK_COUNTback to summary
private static final CssMetaData<ValueAxis<? extends Number>, Number> MINOR_TICK_COUNT
MINOR_TICK_LENGTHback to summary
private static final CssMetaData<ValueAxis<? extends Number>, Number> MINOR_TICK_LENGTH
MINOR_TICK_VISIBLEback to summary
private static final CssMetaData<ValueAxis<? extends Number>, Boolean> MINOR_TICK_VISIBLE
STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()