Class Ticks

    • Method Detail

      • getFontContainer

        public FontContainer getFontContainer()
        Description copied from interface: HasFont
        Returns a font container instance to use in the default methods of this interface.
        Specified by:
        getFontContainer in interface HasFont
        Returns:
        a font container instance
      • getMajor

        public Major getMajor()
        Returns the major element.
        Specified by:
        getMajor in interface IsDefaultTicks
        Returns:
        the major
      • getBackdropPadding

        public Padding getBackdropPadding()
        Returns the padding of label backdrop.
        Specified by:
        getBackdropPadding in interface IsDefaultTicks
        Returns:
        the padding of label backdrop
      • setDisplay

        public void setDisplay​(boolean display)
        If true, show tick marks.
        Parameters:
        display - if true, show tick marks.
      • isDisplay

        public boolean isDisplay()
        If true, show tick marks.
        Specified by:
        isDisplay in interface IsDefaultTicks
        Returns:
        if true, show tick marks.
      • setAutoSkip

        public void setAutoSkip​(boolean autoSkip)
        If true, automatically calculates how many labels that can be shown and hides labels accordingly.
        Turn it off to show all labels no matter what
        Parameters:
        autoSkip - if true, automatically calculates how many labels that can be shown and hides labels accordingly.
        Turn it off to show all labels no matter what
      • isAutoSkip

        public boolean isAutoSkip()
        If true, automatically calculates how many labels that can be shown and hides labels accordingly.
        Turn it off to show all labels no matter what
        Specified by:
        isAutoSkip in interface IsDefaultTicks
        Returns:
        if true, automatically calculates how many labels that can be shown and hides labels accordingly.
        Turn it off to show all labels no matter what.
      • setAutoSkipPadding

        public void setAutoSkipPadding​(int autoSkipPadding)
        Sets the padding between the ticks on the horizontal axis when autoSkip is enabled.
        Note: Only applicable to horizontal scales.
        Parameters:
        autoSkipPadding - padding between the ticks on the horizontal axis when autoSkip is enabled.
        Note: Only applicable to horizontal scales.
      • getAutoSkipPadding

        public int getAutoSkipPadding()
        Returns the padding between the ticks on the horizontal axis when autoSkip is enabled.
        Note: Only applicable to horizontal scales.
        Specified by:
        getAutoSkipPadding in interface IsDefaultTicks
        Returns:
        padding between the ticks on the horizontal axis when autoSkip is enabled.
        Note: Only applicable to horizontal scales.
      • setIncludeBounds

        public void setIncludeBounds​(boolean includeBounds)
        If true, the defined min and maximum values should be presented as ticks even if they are not "nice"
        Parameters:
        includeBounds - if true, the defined min and maximum values should be presented as ticks even if they are not "nice"
      • isIncludeBounds

        public boolean isIncludeBounds()
        If true, the defined minimum and maximum values should be presented as ticks even if they are not "nice".
        Specified by:
        isIncludeBounds in interface IsDefaultTicks
        Returns:
        if true, the defined min and maximum values should be presented as ticks even if they are not "nice"
      • setLabelOffset

        public void setLabelOffset​(int labelOffset)
        Sets the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis).
        Note: this can cause labels at the edges to be cropped by the edge of the canvas.
        Parameters:
        labelOffset - the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis)
      • getLabelOffset

        public int getLabelOffset()
        Returns the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis).
        Note: this can cause labels at the edges to be cropped by the edge of the canvas.
        Specified by:
        getLabelOffset in interface IsDefaultTicks
        Returns:
        the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis).
      • setCount

        public void setCount​(int count)
        Sets the number of ticks to generate.
        If specified, this overrides the automatic generation.
        Parameters:
        count - the number of ticks to generate.
        If specified, this overrides the automatic generation
      • getCount

        public int getCount()
        Returns the number of ticks to generate.
        If specified, this overrides the automatic generation.
        Specified by:
        getCount in interface IsDefaultTicks
        Returns:
        the number of ticks to generate.
        If specified, this overrides the automatic generation
      • setMaxRotation

        public void setMaxRotation​(int maxRotation)
        Sets the maximum rotation for tick labels when rotating to condense labels.
        Note: Rotation doesn't occur until necessary.
        Note: Only applicable to horizontal scales.
        Parameters:
        maxRotation - maximum rotation for tick labels when rotating to condense labels.
        Note: Rotation doesn't occur until necessary.
        Note: Only applicable to horizontal scales.
      • getMaxRotation

        public int getMaxRotation()
        Returns the maximum rotation for tick labels when rotating to condense labels.
        Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.
        Specified by:
        getMaxRotation in interface IsDefaultTicks
        Returns:
        maximum rotation for tick labels when rotating to condense labels.
        Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.
      • setMinRotation

        public void setMinRotation​(int minRotation)
        Sets the minimum rotation for tick labels.
        Note: Only applicable to horizontal scales.
        Parameters:
        minRotation - minimum rotation for tick labels.
        Note: Only applicable to horizontal scales.
      • getMinRotation

        public int getMinRotation()
        Returns the minimum rotation for tick labels.
        Note: Only applicable to horizontal scales.
        Specified by:
        getMinRotation in interface IsDefaultTicks
        Returns:
        minimum rotation for tick labels.
        Note: Only applicable to horizontal scales.
      • setMirror

        public void setMirror​(boolean mirror)
        Sets the flips tick labels around axis, displaying the labels inside the chart instead of outside.
        Note: Only applicable to vertical scales.
        Parameters:
        mirror - flips tick labels around axis, displaying the labels inside the chart instead of outside.
        Note: Only applicable to vertical scales.
      • isMirror

        public boolean isMirror()
        Returns the flips tick labels around axis, displaying the labels inside the chart instead of outside.
        Note: Only applicable to vertical scales.
        Specified by:
        isMirror in interface IsDefaultTicks
        Returns:
        flips tick labels around axis, displaying the labels inside the chart instead of outside.
        Note: Only applicable to vertical scales.
      • setPadding

        public void setPadding​(int padding)
        Sets the padding between the tick label and the axis.
        When set on a vertical axis, this applies in the horizontal (X) direction.
        When set on a horizontal axis, this applies in the vertical (Y) direction.
        Parameters:
        padding - padding between the tick label and the axis.
        When set on a vertical axis, this applies in the horizontal (X) direction.
        When set on a horizontal axis, this applies in the vertical (Y) direction.
      • getPadding

        public int getPadding()
        Returns the padding between the tick label and the axis.
        When set on a vertical axis, this applies in the horizontal (X) direction.
        When set on a horizontal axis, this applies in the vertical (Y) direction.
        Specified by:
        getPadding in interface IsDefaultTicks
        Returns:
        padding between the tick label and the axis.
        When set on a vertical axis, this applies in the horizontal (X) direction.
        When set on a horizontal axis, this applies in the vertical (Y) direction.
      • setMaxTicksLimit

        public void setMaxTicksLimit​(int maxTicksLimit)
        Sets the maximum number of ticks and grid to show.
        Parameters:
        maxTicksLimit - maximum number of ticks and grid to show.
      • getMaxTicksLimit

        public int getMaxTicksLimit()
        Returns the maximum number of ticks and grid to show.
        Specified by:
        getMaxTicksLimit in interface IsDefaultTicks
        Returns:
        maximum number of ticks and grid to show.
      • setStepSize

        public void setStepSize​(double stepSize)
        Sets the user defined fixed step size for the scale.
        Parameters:
        stepSize - user defined fixed step size for the scale.
      • getStepSize

        public double getStepSize()
        Returns the user defined fixed step size for the scale.
        Specified by:
        getStepSize in interface IsDefaultTicks
        Returns:
        user defined fixed step size for the scale.
      • setBackdropColor

        public void setBackdropColor​(IsColor backdropColor)
        Sets the color of label backdrops.
        Parameters:
        backdropColor - color of label backdrops.
      • setBackdropColor

        public void setBackdropColor​(String backdropColor)
        Sets the color of label backdrops.
        Parameters:
        backdropColor - color of label backdrops.
      • getBackdropColor

        public IsColor getBackdropColor()
        Returns the color of label backdrops.
        Returns:
        color of label backdrops.
      • setShowLabelBackdrop

        public void setShowLabelBackdrop​(boolean showLabelBackdrop)
        If true, draw a background behind the tick labels.
        Parameters:
        showLabelBackdrop - if true, draw a background behind the tick labels.
      • isShowLabelBackdrop

        public boolean isShowLabelBackdrop()
        If true, draw a background behind the tick labels.
        Specified by:
        isShowLabelBackdrop in interface IsDefaultTicks
        Returns:
        if true, draw a background behind the tick labels.
      • setSource

        public void setSource​(TickSource source)
        Sets the property controls the ticks generation.
        Parameters:
        source - property controls the ticks generation.
      • getSource

        public TickSource getSource()
        Returns the property controls the ticks generation.
        Specified by:
        getSource in interface IsDefaultTicks
        Returns:
        property controls the ticks generation.
      • setPrecision

        public void setPrecision​(int precision)
        If defined and stepSize is not specified, the step size will be rounded to this many decimal places.
        Parameters:
        precision - if defined and stepSize is not specified, the step size will be rounded to this many decimal places.
      • getPrecision

        public int getPrecision()
        If defined and stepSize is not specified, the step size will be rounded to this many decimal places.
        Specified by:
        getPrecision in interface IsDefaultTicks
        Returns:
        if defined and stepSize is not specified, the step size will be rounded to this many decimal places.
      • setZ

        public void setZ​(int z)
        Sets z-index of tick layer. Useful when ticks are drawn on chart area.
        Values less than or equals to 0 are drawn under datasets, greater than 0 on top.
        Parameters:
        z - z-index of tick layer. Useful when ticks are drawn on chart area.
        Values less than or equals to 0 are drawn under datasets, greater than 0 on top.
      • getZ

        public int getZ()
        Returns z-index of tick layer. Useful when ticks are drawn on chart area.
        Values less than or equals to 0 are drawn under datasets, greater than 0 on top.
        Specified by:
        getZ in interface IsDefaultTicks
        Returns:
        z-index of tick layer. Useful when ticks are drawn on chart area.
        Values less than or equals to 0 are drawn under datasets, greater than 0 on top.
      • setSampleSize

        public void setSampleSize​(int sampleSize)
        Sets the number of ticks to examine when deciding how many labels will fit.
        Setting a smaller value will be faster, but may be less accurate when there is large variability in label length.
        Parameters:
        sampleSize - the number of ticks to examine when deciding how many labels will fit.
      • getSampleSize

        public int getSampleSize()
        Returns the number of ticks to examine when deciding how many labels will fit.
        Setting a smaller value will be faster, but may be less accurate when there is large variability in label length.
        Specified by:
        getSampleSize in interface IsDefaultTicks
        Returns:
        the number of ticks to examine when deciding how many labels will fit.
      • setAlign

        public void setAlign​(TickAlign align)
        Sets the tick alignment along the axis.
        Parameters:
        align - the tick alignment along the axis
      • getAlign

        public TickAlign getAlign()
        Returns the tick alignment along the axis.
        Specified by:
        getAlign in interface IsDefaultTicks
        Returns:
        the tick alignment along the axis
      • setCrossAlign

        public void setCrossAlign​(CrossAlign crossAlign)
        Sets the tick alignment perpendicular to the axis.
        Parameters:
        crossAlign - the tick alignment perpendicular to the axis
      • getCrossAlign

        public CrossAlign getCrossAlign()
        Returns the tick alignment perpendicular to the axis.
        Specified by:
        getCrossAlign in interface IsDefaultTicks
        Returns:
        the tick alignment perpendicular to the axis
      • setTextStrokeColor

        public final void setTextStrokeColor​(IsColor color)
        Sets the text stroke color.
        Parameters:
        color - the text stroke color
      • setTextStrokeColor

        public final void setTextStrokeColor​(String color)
        Sets the text stroke color.
        Parameters:
        color - the text stroke color.
      • getTextStrokeColorAsString

        public final String getTextStrokeColorAsString()
        Returns the text stroke color as string.
        Specified by:
        getTextStrokeColorAsString in interface IsDefaultTicks
        Returns:
        the text stroke color as string.
      • getTextStrokeColor

        public final IsColor getTextStrokeColor()
        Returns the text stroke color.
        Returns:
        the text stroke color.
      • setTextStrokeWidth

        public final void setTextStrokeWidth​(int textStrokeWidth)
        Sets the text stroke width.
        Parameters:
        textStrokeWidth - the text stroke width.
      • getTextStrokeWidth

        public final int getTextStrokeWidth()
        Returns the text stroke width.
        Specified by:
        getTextStrokeWidth in interface IsDefaultTicks
        Returns:
        the text stroke width.