java.lang.Object
- All Implemented Interfaces:
- Styleable,- EventTarget
public final class NumberAxis extends ValueAxis<Number>
An axis class that plots a range of numbers with major tick marks every tickUnit.
 You can use any Number type with this axis.
- Since:
- JavaFX 2.0
- 
Property SummaryProperties Type Property Description BooleanPropertyforceZeroInRangeWhen true zero is always included in the visible range.DoublePropertytickUnitThe value between each major tick mark in data units.Properties declared in class javafx.scene.chart.ValueAxislowerBound, minorTickCount, minorTickLength, minorTickVisible, scale, tickLabelFormatter, upperBoundProperties declared in class javafx.scene.chart.Axisanimated, autoRanging, label, side, tickLabelFill, tickLabelFont, tickLabelGap, tickLabelRotation, tickLabelsVisible, tickLength, tickMarkVisibleProperties declared in class javafx.scene.layout.Regionbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties declared in class javafx.scene.ParentneedsLayoutProperties declared in class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classNumberAxis.DefaultFormatterDefault number formatter for NumberAxis, this stays in sync with auto-ranging and formats values appropriately.Nested classes/interfaces declared in class javafx.scene.chart.AxisAxis.TickMark<T>
- 
Field SummaryFields declared in class javafx.scene.chart.ValueAxiscurrentLowerBoundFields declared in class javafx.scene.layout.RegionUSE_COMPUTED_SIZE, USE_PREF_SIZEFields declared in class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructors Constructor 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(String axisLabel, double lowerBound, double upperBound, double tickUnit)Creates a non-auto-ranging NumberAxis with the given lower bound, upper bound and tick unit.
- 
Method SummaryModifier and Type Method Description protected ObjectautoRange(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 List<Number>calculateMinorTickMarks()Calculates a list of the data values for every minor tick markprotected List<Number>calculateTickValues(double length, Object range)Calculates a list of all the data values for each tick mark in rangeBooleanPropertyforceZeroInRangeProperty()When true zero is always included in the visible range.static List<CssMetaData<? extends Styleable,?>>getClassCssMetaData()List<CssMetaData<? extends Styleable,?>>getCssMetaData()This method should delegate toNode.getClassCssMetaData()so that a Node's CssMetaData can be accessed without the need for reflection.protected ObjectgetRange()Called to get the current axis range.protected StringgetTickMarkLabel(Number value)Get the string label name for a tick mark with the given value.doublegetTickUnit()Gets the value of the property tickUnit.booleanisForceZeroInRange()Gets the value of the property forceZeroInRange.protected Dimension2DmeasureTickMarkSize(Number value, Object range)Measures the size of the label for a given tick mark value.voidsetForceZeroInRange(boolean value)Sets the value of the property forceZeroInRange.protected voidsetRange(Object range, boolean animate)Called to set the current axis range to the given range.voidsetTickUnit(double value)Sets the value of the property tickUnit.DoublePropertytickUnitProperty()The value between each major tick mark in data units.Methods declared in class javafx.scene.chart.ValueAxisautoRange, calculateNewScale, getDisplayPosition, getLowerBound, getMinorTickCount, getMinorTickLength, getScale, getTickLabelFormatter, getUpperBound, getValueForDisplay, getZeroPosition, invalidateRange, isMinorTickVisible, isValueOnAxis, layoutChildren, lowerBoundProperty, minorTickCountProperty, minorTickLengthProperty, minorTickVisibleProperty, scaleProperty, setLowerBound, setMinorTickCount, setMinorTickLength, setMinorTickVisible, setScale, setTickLabelFormatter, setUpperBound, tickLabelFormatterProperty, tickMarksUpdated, toNumericValue, toRealValue, upperBoundPropertyMethods declared in class javafx.scene.chart.AxisanimatedProperty, autoRangingProperty, computePrefHeight, computePrefWidth, getAnimated, getLabel, getSide, getTickLabelFill, getTickLabelFont, getTickLabelGap, getTickLabelRotation, getTickLength, getTickMarks, invalidateRange, isAutoRanging, isRangeValid, isTickLabelsVisible, isTickMarkVisible, labelProperty, measureTickMarkLabelSize, measureTickMarkSize, requestAxisLayout, requestLayout, setAnimated, setAutoRanging, setLabel, setSide, setTickLabelFill, setTickLabelFont, setTickLabelGap, setTickLabelRotation, setTickLabelsVisible, setTickLength, setTickMarkVisible, shouldAnimate, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisiblePropertyMethods declared in class javafx.scene.layout.RegionbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods declared in class javafx.scene.ParentgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, needsLayoutProperty, requestParentLayout, setNeedsLayout, updateBoundsMethods declared in class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface javafx.css.StyleablegetStyleableNode, getStyleClass
- 
Property Details- 
forceZeroInRangeWhen true zero is always included in the visible range. This only has effect if auto-ranging is on.- See Also:
- isForceZeroInRange(),- setForceZeroInRange(boolean)
 
- 
tickUnitThe value between each major tick mark in data units. This is automatically set if we are auto-ranging.- See Also:
- getTickUnit(),- setTickUnit(double)
 
 
- 
- 
Constructor Details- 
NumberAxispublic NumberAxis()Creates an auto-ranging NumberAxis.
- 
NumberAxispublic NumberAxis(double lowerBound, double upperBound, double tickUnit)Creates a non-auto-ranging NumberAxis with the given upper bound, lower bound and tick unit.- Parameters:
- lowerBound- The lower bound for this axis, i.e. min plottable value
- upperBound- The upper bound for this axis, i.e. max plottable value
- tickUnit- The tick unit, i.e. space between tickmarks
 
- 
NumberAxisCreates a non-auto-ranging NumberAxis with the given lower bound, upper bound and tick unit.- Parameters:
- axisLabel- The name to display for this axis
- lowerBound- The lower bound for this axis, i.e. min plottable value
- upperBound- The upper bound for this axis, i.e. max plottable value
- tickUnit- The tick unit, i.e. space between tickmarks
 
 
- 
- 
Method Details- 
isForceZeroInRangepublic final boolean isForceZeroInRange()Gets the value of the property forceZeroInRange.- Property description:
- When true zero is always included in the visible range. This only has effect if auto-ranging is on.
 
- 
setForceZeroInRangepublic final void setForceZeroInRange(boolean value)Sets the value of the property forceZeroInRange.- Property description:
- When true zero is always included in the visible range. This only has effect if auto-ranging is on.
 
- 
forceZeroInRangePropertyWhen true zero is always included in the visible range. This only has effect if auto-ranging is on.- See Also:
- isForceZeroInRange(),- setForceZeroInRange(boolean)
 
- 
getTickUnitpublic final double getTickUnit()Gets the value of the property tickUnit.- Property description:
- The value between each major tick mark in data units. This is automatically set if we are auto-ranging.
 
- 
setTickUnitpublic final void setTickUnit(double value)Sets the value of the property tickUnit.- Property description:
- The value between each major tick mark in data units. This is automatically set if we are auto-ranging.
 
- 
tickUnitPropertyThe value between each major tick mark in data units. This is automatically set if we are auto-ranging.- See Also:
- getTickUnit(),- setTickUnit(double)
 
- 
getTickMarkLabelGet the string label name for a tick mark with the given value.- Specified by:
- getTickMarkLabelin class- Axis<Number>
- Parameters:
- value- The value to format into a tick label string
- Returns:
- A formatted string for the given value
 
- 
getRangeCalled to get the current axis range.
- 
setRangeCalled to set the current axis range to the given range. If isAnimating() is true then this method should animate the range to the new range.
- 
calculateTickValuesCalculates a list of all the data values for each tick mark in range- Specified by:
- calculateTickValuesin class- Axis<Number>
- Parameters:
- length- The length of the axis in display units
- range- A range object returned from autoRange()
- Returns:
- A list of tick marks that fit along the axis if it was the given length
 
- 
calculateMinorTickMarksCalculates a list of the data values for every minor tick mark- Specified by:
- calculateMinorTickMarksin class- ValueAxis<Number>
- Returns:
- List of data values where to draw minor tick marks
 
- 
measureTickMarkSizeMeasures the size of the label for a given tick mark value. This uses the font that is set for the tick marks.- Overrides:
- measureTickMarkSizein class- Axis<Number>
- Parameters:
- value- tick mark value
- range- range to use during calculations
- Returns:
- size of tick mark label for given value
 
- 
autoRangeCalled to set the upper and lower bound and anything else that needs to be auto-ranged.- Overrides:
- autoRangein class- ValueAxis<Number>
- Parameters:
- minValue- The min data value that needs to be plotted on this axis
- maxValue- The max data value that needs to be plotted on this axis
- length- The length of the axis in display coordinates
- labelSize- The approximate average size a label takes along the axis
- Returns:
- The calculated range
 
- 
getClassCssMetaData- Returns:
- The CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
- Since:
- JavaFX 8.0
 
- 
getCssMetaDataThis method should delegate toNode.getClassCssMetaData()so that a Node's CssMetaData can be accessed without the need for reflection.- Specified by:
- getCssMetaDatain interface- Styleable
- Overrides:
- getCssMetaDatain class- ValueAxis<Number>
- Returns:
- The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.
- Since:
- JavaFX 8.0
 
 
-