Class YAxis

  • All Implemented Interfaces:
    Serializable, OptionDataListener, org.zkoss.json.JSONAware
    Direct Known Subclasses:
    ColorAxis, ParallelAxes

    public class YAxis
    extends XAxis
    The Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the horizontal axis. In case of multiple axes, the yAxis node is an array of configuration objects.
    Author:
    jumperchen
    See Also:
    Serialized Form
    • Constructor Detail

      • YAxis

        public YAxis()
    • Method Detail

      • getStackLabels

        public StackLabels getStackLabels()
        Returns the stack labels show the total value for each bar in a stacked column or bar chart. The label will be placed on top of positive columns and below negative columns. In case of an inverted column chart or a bar chart the label is placed to the right of positive bars and to the left of negative bars.
      • setStackLabels

        public void setStackLabels​(StackLabels stackLabels)
        Sets the stack labels show the total value for each bar in a stacked column or bar chart. The label will be placed on top of positive columns and below negative columns. In case of an inverted column chart or a bar chart the label is placed to the right of positive bars and to the left of negative bars.
      • getStackShadow

        public StackShadow getStackShadow()
        Returns the stack labels show the total value for each bar in a stacked column or bar chart. The label will be placed on top of positive columns and below negative columns. In case of an inverted column chart or a bar chart the label is placed to the right of positive bars and to the left of negative bars.
        Since:
        11.2.0.0
      • setStackShadow

        public void setStackShadow​(StackShadow stackShadow)
        Sets the stack labels show the total value for each bar in a stacked column or bar chart. The label will be placed on top of positive columns and below negative columns. In case of an inverted column chart or a bar chart the label is placed to the right of positive bars and to the left of negative bars.
        Since:
        11.2.0.0
      • isEndOnTick

        public boolean isEndOnTick()
        Returns whether to force the axis to end on a tick. Use this option with the setMaxPadding(Number) option to control the axis end.

        Default: true.

        Overrides:
        isEndOnTick in class Axis
        Returns:
        endOnTick whether to force the axis to end on a tick
      • setEndOnTick

        public void setEndOnTick​(boolean endOnTick)
        Sets whether to force the axis to end on a tick. Use this option with the setMaxPadding(Number) option to control the axis end.

        Default: true.

        Overrides:
        setEndOnTick in class Axis
        Parameters:
        endOnTick - whether to force the axis to end on a tick
      • isStartOnTick

        public boolean isStartOnTick()
        Returns whether to force the axis to start on a tick. Use this option with the maxPadding option to control the axis start.

        Default: true.

        Overrides:
        isStartOnTick in class Axis
      • getTickWidth

        public Number getTickWidth()
        Returns the pixel width of the major tick marks.

        Default: 0.

        Overrides:
        getTickWidth in class Axis
      • setTickWidth

        public void setTickWidth​(Number tickWidth)
        Sets the pixel width of the major tick marks.
        Overrides:
        setTickWidth in class Axis
      • getTooltipValueFormat

        public String getTooltipValueFormat()
        Parallel coordinates only. Returns a format that will be used for point.y and available in tooltip.pointFormat as {point.formattedValue}. If not set, {point.formattedValue} will use other options, in this order:
        1. yAxis.labels.format will be used if set
        2. If yAxis is a category, then category name will be displayed
        3. If yAxis is a datetime, then value will use the same format as yAxis labels
        4. If yAxis is linear/logarithmic type, then simple value will be used

        Default: null

        Since:
        7.2.1.0
      • setTooltipValueFormat

        public void setTooltipValueFormat​(String tooltipValueFormat)
        Parallel coordinates only. Sets a format that will be used for point.y and available in tooltip.pointFormat as {point.formattedValue}. If not set, {point.formattedValue} will use other options, in this order:
        1. yAxis.labels.format will be used if set
        2. If yAxis is a category, then category name will be displayed
        3. If yAxis is a datetime, then value will use the same format as yAxis labels
        4. If yAxis is linear/logarithmic type, then simple value will be used
        Since:
        7.2.1.0
      • getMaxColor

        public Color getMaxColor()
        Returns the max color. Solid gauge only. Unless stops are set, the color to represent the maximum value of the Y axis.

        Default: #102D4C.

      • setMaxColor

        public void setMaxColor​(Color color)
        Sets the the max color. Solid gauge only. Unless stops are set, the color to represent the maximum value of the Y axis.
      • setMaxColor

        public void setMaxColor​(String color)
        Sets the the max color. Solid gauge only. Unless stops are set, the color to represent the maximum value of the Y axis.
      • setMaxColor

        public void setMaxColor​(LinearGradient color)
        Sets the the max color. Solid gauge only. Unless stops are set, the color to represent the maximum value of the Y axis.
      • setMaxColor

        public void setMaxColor​(RadialGradient color)
        Sets the the max color. Solid gauge only. Unless stops are set, the color to represent the maximum value of the Y axis.
      • getMaxPadding

        public Number getMaxPadding()
        Returns padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the highest data value to appear on the edge of the plot area. When the Axis.setMax(Number) option is set or a max extreme is set using Axis.setExtremes(Number, Number), the maxPadding will be ignored.

        Default: 0.05.

        Overrides:
        getMaxPadding in class Axis
      • setMaxPadding

        public void setMaxPadding​(Number maxPadding)
        Sets padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the highest data value to appear on the edge of the plot area. When the Axis.setMax(Number) option is set or a max extreme is set using Axis.setExtremes(Number, Number), the maxPadding will be ignored.
        Overrides:
        setMaxPadding in class Axis
      • getMinColor

        public Color getMinColor()
        Returns the min color. Solid gauge only. Unless stops are set, the color to represent the minimum value of the Y axis.

        Default: #EFEFFF.

      • setMinColor

        public void setMinColor​(Color color)
        Sets the min color. Solid gauge only. Unless stops are set, the color to represent the minimum value of the Y axis.
      • setMinColor

        public void setMinColor​(String color)
        Sets the min color. Solid gauge only. Unless stops are set, the color to represent the minimum value of the Y axis.
      • setMinColor

        public void setMinColor​(LinearGradient color)
        Sets the min color. Solid gauge only. Unless stops are set, the color to represent the minimum value of the Y axis.
      • setMinColor

        public void setMinColor​(RadialGradient color)
        Sets the min color. Solid gauge only. Unless stops are set, the color to represent the minimum value of the Y axis.
      • getMinPadding

        public Number getMinPadding()
        Returns padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the lowest data value to appear on the edge of the plot area. When the Axis.setMin(Number) option is set or a min extreme is set using Axis.setExtremes(Number, Number), the minPadding will be ignored.

        Default: 0.05.

        Overrides:
        getMinPadding in class Axis
      • setMinPadding

        public void setMinPadding​(Number minPadding)
        Sets padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the lowest data value to appear on the edge of the plot area. When the Axis.setMin(Number) option is set or a min extreme is set using Axis.setExtremes(Number, Number), the minPadding will be ignored.
        Overrides:
        setMinPadding in class Axis
      • isReversed

        public boolean isReversed()
        Returns whether to reverse the axis so that the highest number is closest to the origin.

        Default: false.

        Overrides:
        isReversed in class Axis
        Since:
        11.2.0.0
      • setReversed

        public void setReversed​(boolean reversed)
        Sets whether to reverse the axis so that the highest number is closest to the origin.

        Default: false.

        Overrides:
        setReversed in class Axis
        Since:
        11.2.0.0
      • isReversedStacks

        public boolean isReversedStacks()
        Returns the reversedStacks. If true, the first series in a stack will be drawn on top in a positive, non-reversed Y axis. If false, the first series is in the base of the stack.

        Default: true.

        Overrides:
        isReversedStacks in class Axis
      • setReversedStacks

        public void setReversedStacks​(boolean reversedStacks)
        Sets the reversedStacks. If true, the first series in a stack will be drawn on top in a positive, non-reversed Y axis. If false, the first series is in the base of the stack.

        Default: true.

        Overrides:
        setReversedStacks in class Axis
      • getStops

        public List<Stop> getStops()
        Get the list of stop colors.

        Default: null

        Returns:
        list of stop colors
        See Also:
        Stop
      • setStops

        public void setStops​(List<Stop> stops)
        Solid gauge series only. Color stops for the solid gauge.
        Parameters:
        stops - a list of stop colors
        See Also:
        Stop
      • setStops

        public void setStops​(Stop... stops)
        Solid gauge series only. Color stops for the solid gauge.
        Parameters:
        stops - an array of stop colors
        See Also:
        Stop
      • getGridLineWidth

        public Number getGridLineWidth()
        Returns the width of the grid lines extending the ticks across the plot area.

        Default: 1.

        Overrides:
        getGridLineWidth in class Axis
      • setGridLineWidth

        public void setGridLineWidth​(Number gridLineWidth)
        Sets the width of the grid lines extending the ticks across the plot area.
        Overrides:
        setGridLineWidth in class Axis
      • getTickPixelInterval

        public Number getTickPixelInterval()
        Returns if tickInterval is null this option sets the approximate pixel interval of the tick marks. Not applicable to categorized axis. Defaults to 72 for the Y axis and 100 for the X axis.

        Default: 72.

        Overrides:
        getTickPixelInterval in class Axis
      • setTickPixelInterval

        public void setTickPixelInterval​(Number tickPixelInterval)
        Sets if tickInterval is null this option sets the approximate pixel interval of the tick marks. Not applicable to categorized axis. Defaults to 72 for the Y axis and 100 for the X axis.

        Default: 72.

        Overrides:
        setTickPixelInterval in class Axis
      • getLabels

        public AxisLabels getLabels()
        Returns the axis labels show the number or category for each tick.

        Default:

         labels: {
                  x: -8,
                  y: 3
         }
         
        Overrides:
        getLabels in class Axis
      • getLineWidth

        public Number getLineWidth()
        Returns the width of the line marking the axis itself.

        Default: 0.

        Overrides:
        getLineWidth in class XAxis
      • setLineWidth

        public void setLineWidth​(Number lineWidth)
        Sets the width of the line marking the axis itself.
        Overrides:
        setLineWidth in class XAxis
      • getTitle

        public AxisTitle getTitle()
        Returns the axis title, showing next to the axis line.

        Default: an instance of AxisTitle.

        Overrides:
        getTitle in class Axis
      • getGridLineInterpolation

        public String getGridLineInterpolation()
        Get whether the grid lines should draw as a polygon with straight lines between categories, or as circles. Can be either circle or polygon.

        Defaults to null.

        Since:
        2.1.0
      • setGridLineInterpolation

        public void setGridLineInterpolation​(String gridLineInterpolation)
        Set whether the grid lines should draw as a polygon with straight lines between categories, or as circles. Can be either circle or polygon.
        Parameters:
        gridLineInterpolation -
        Since:
        2.1.0