Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Axis

[22:7] extends: Region

The Axis class wraps javafx.scene.chart.Axis, the abstract base for the chart axes (CategoryAxis and, through ValueAxis, NumberAxis). It extends Region and provides the label, side, auto-ranging, animation, and tick-label styling shared by every axis. The type-specific position and range methods (getDisplayPosition, getValueForDisplay, isValueOnAxis, toNumericValue, toRealValue, getZeroPosition, invalidateRange) are abstract on Axis and are implemented by the concrete axis subclasses with their own value type, so they are not wrapped here. This wrapper is not constructed directly. Concrete axes extend it, mirroring the JavaFX inheritance model.

Methods

  • Axis ()

    Base constructor. Axis is abstract and is never instantiated on its own.

  • setLabel (string Label)

    Sets the axis label text.

    • @p Label is a string with the label text.
    • @r this object for chaining
  • getLabel ()

    Returns the axis label text.

    • @r A string with the label, or null when none is set.
  • labelProperty ()

    Returns the ObjectProperty backing the label.

    • @r An AJO wrapping ObjectProperty.
  • setSide (string SideName)

    Sets which side of the chart the axis is placed on.

    • @p SideName is a javafx.geometry.Side constant name: TOP, BOTTOM, LEFT, or RIGHT.
    • @r this object for chaining
  • getSide ()

    Returns which side of the chart the axis is placed on.

    • @r An AJO wrapping javafx.geometry.Side.
  • sideProperty ()

    Returns the ObjectProperty backing the side.

    • @r An AJO wrapping ObjectProperty.
  • setAutoRanging (bool Auto)

    Sets whether the axis automatically determines its range from the data.

    • @p Auto is a bool; true enables auto-ranging.
    • @r this object for chaining
  • isAutoRanging ()

    Returns whether the axis auto-ranges.

    • @r A bool that is true when auto-ranging is enabled.
  • autoRangingProperty ()

    Returns the BooleanProperty backing the auto-ranging flag.

    • @r An AJO wrapping javafx.beans.property.BooleanProperty.
  • setAnimated (bool Animated)

    Sets whether axis range changes are animated.

    • @p Animated is a bool; true enables animation.
    • @r this object for chaining
  • getAnimated ()

    Returns whether axis range changes are animated.

    • @r A bool that is true when animation is enabled.
  • animatedProperty ()

    Returns the BooleanProperty backing the animated flag.

    • @r An AJO wrapping javafx.beans.property.BooleanProperty.
  • setTickLabelsVisible (bool Visible)

    Sets whether tick labels are visible.

    • @p Visible is a bool; true shows the tick labels.
    • @r this object for chaining
  • isTickLabelsVisible ()

    Returns whether tick labels are visible.

    • @r A bool that is true when tick labels are shown.
  • tickLabelsVisibleProperty ()

    Returns the BooleanProperty backing the tick label visibility.

    • @r An AJO wrapping javafx.beans.property.BooleanProperty.
  • setTickMarkVisible (bool Visible)

    Sets whether tick marks are visible.

    • @p Visible is a bool; true shows the tick marks.
    • @r this object for chaining
  • isTickMarkVisible ()

    Returns whether tick marks are visible.

    • @r A bool that is true when tick marks are shown.
  • tickMarkVisibleProperty ()

    Returns the BooleanProperty backing the tick mark visibility.

    • @r An AJO wrapping javafx.beans.property.BooleanProperty.
  • setTickLength (double Length)

    Sets the length, in pixels, of the tick marks.

    • @p Length is a double with the tick length.
    • @r this object for chaining
  • getTickLength ()

    Returns the length, in pixels, of the tick marks.

    • @r A double with the tick length.
  • tickLengthProperty ()

    Returns the DoubleProperty backing the tick length.

    • @r An AJO wrapping javafx.beans.property.DoubleProperty.
  • setTickLabelGap (double Gap)

    Sets the gap, in pixels, between a tick mark and its label.

    • @p Gap is a double with the gap.
    • @r this object for chaining
  • getTickLabelGap ()

    Returns the gap, in pixels, between a tick mark and its label.

    • @r A double with the gap.
  • tickLabelGapProperty ()

    Returns the DoubleProperty backing the tick label gap.

    • @r An AJO wrapping javafx.beans.property.DoubleProperty.
  • setTickLabelRotation (double Rotation)

    Sets the rotation angle, in degrees, of the tick labels.

    • @p Rotation is a double with the rotation angle.
    • @r this object for chaining
  • getTickLabelRotation ()

    Returns the rotation angle, in degrees, of the tick labels.

    • @r A double with the rotation angle.
  • tickLabelRotationProperty ()

    Returns the DoubleProperty backing the tick label rotation.

    • @r An AJO wrapping javafx.beans.property.DoubleProperty.
  • setTickLabelFill (Fill)

    Sets the paint used to fill the tick labels.

    • @p Fill is a javafx.scene.paint.Paint (for example a Color), passed as a wrapper or a raw AJO.
    • @r this object for chaining
  • getTickLabelFill ()

    Returns the paint used to fill the tick labels.

    • @r An AJO wrapping javafx.scene.paint.Paint.
  • tickLabelFillProperty ()

    Returns the ObjectProperty backing the tick label fill.

    • @r An AJO wrapping ObjectProperty.
  • setTickLabelFont (LabelFont)

    Sets the font used for the tick labels.

    • @p LabelFont is a javafx.scene.text.Font, passed as a wrapper or a raw AJO.
    • @r this object for chaining
  • getTickLabelFont ()

    Returns the font used for the tick labels.

    • @r An AJO wrapping javafx.scene.text.Font.
  • tickLabelFontProperty ()

    Returns the ObjectProperty backing the tick label font.

    • @r An AJO wrapping ObjectProperty.
  • getDisplayPosition (Value)

    Returns the pixel position along the axis for a data value.

    • @p Value is the axis value (a number for a numeric axis, or a string for a category axis).
    • @r A double with the display position in pixels.
  • getValueForDisplay (double Position)

    Returns the data value at a pixel position along the axis.

    • @p Position is a double with the display position in pixels.
    • @r The axis value at that position (a number or a string).
  • getZeroPosition ()

    Returns the pixel position of the zero line, or infinity when zero is not on the axis.

    • @r A double with the zero position in pixels.
  • isValueOnAxis (Value)

    Returns whether a data value falls within the current axis range.

    • @p Value is the axis value to test.
    • @r A bool that is true when the value is on the axis.
  • toNumericValue (Value)

    Converts a data value to its numeric representation.

    • @p Value is the axis value.
    • @r A double with the numeric value.
  • toRealValue (double Value)

    Converts a numeric value to the axis's real data value.

    • @p Value is a double with the numeric value.
    • @r The real axis value (a number or a string).
  • getTickMarks ()

    Returns the tick marks currently displayed on the axis.

    • @r An AJO wrapping ObservableList<Axis.TickMark>.
  • invalidateRange (list Data)

    Marks the axis range invalid for the given list of data values so it is recomputed on the next layout pass.

    • @p Data is a list of axis values that define the new range.
    • @r this object for chaining
  • requestAxisLayout ()

    Requests that the axis be laid out again on the next pulse.

    • @r this object for chaining