Class CategoryAxis

  • All Implemented Interfaces:
    Axis, de.gsi.dataset.AxisDescription, de.gsi.dataset.event.EventSource, javafx.css.Styleable, javafx.event.EventTarget

    public final class CategoryAxis
    extends DefaultNumericAxis
    A axis implementation that will works on string categories where each value as a unique category(tick mark) along the axis.
    • Constructor Detail

      • CategoryAxis

        public CategoryAxis()
        Create a auto-ranging category axis with an empty list of categories.
      • CategoryAxis

        public CategoryAxis​(javafx.collections.ObservableList<java.lang.String> categories)
        Create a category axis with the given categories. This will not auto-range but be fixed with the given categories.
        Parameters:
        categories - List of the categories for this axis
      • CategoryAxis

        public CategoryAxis​(java.lang.String axisLabel)
        Create a non-auto-ranging Axis with the given upper bound, lower bound and tick unit.
        Parameters:
        axisLabel - the axis label
      • CategoryAxis

        public CategoryAxis​(java.lang.String axisLabel,
                            javafx.collections.ObservableList<java.lang.String> categories)
        Create a non-auto-ranging Axis with the given upper bound, lower bound and tick unit.
        Parameters:
        axisLabel - the axis label
        categories - List of the categories for this axis
    • Method Detail

      • getCategories

        public javafx.collections.ObservableList<java.lang.String> getCategories()
        Returns a ObservableList of categories plotted on this axis.
        Returns:
        ObservableList of categories for this axis.
      • setCategories

        public void setCategories​(java.util.List<java.lang.String> categories)
        Parameters:
        categories - list of strings
      • setCategories

        public void setCategories​(javafx.collections.ObservableList<java.lang.String> categoryList)
        The ordered list of categories plotted on this axis. This is set automatically based on the charts data if autoRanging is true. If the application sets the categories then auto ranging is turned off. If there is an attempt to add duplicate entry into this list, an IllegalArgumentException is thrown. setting the category via axis forces the axis' category, setting the axis categories to null forces the dataset's category
        Parameters:
        categoryList - the category list
      • updateCategories

        public boolean updateCategories​(de.gsi.dataset.DataSet dataSet)
        Update the categories based on the data labels attached to the DataSet values
        Parameters:
        dataSet - data set from which the data labels are used as category
        Returns:
        true is categories were modified, false, false otherwise
      • calculateMinorTickValues

        protected java.util.List<java.lang.Double> calculateMinorTickValues()
        Description copied from class: AbstractAxis
        Calculate a list of the data values for every minor tick mark
        Overrides:
        calculateMinorTickValues in class DefaultNumericAxis
        Returns:
        List of data values where to draw minor tick marks