Class XAxis

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

    public class XAxis
    extends Axis
    The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects.
    Author:
    RaymondChao
    See Also:
    Serialized Form
    • Constructor Detail

      • XAxis

        public XAxis()
    • Method Detail

      • getBreaks

        public List<Break> getBreaks()
        Get the list of breaks defined for this axis.
        Returns:
        list of breaks
        Since:
        2.1.0
        See Also:
        Break
      • setBreaks

        public void setBreaks​(List<Break> breaks)
        Set the list of breaks defined for this axis.
        Parameters:
        breaks -
        Since:
        2.1.0
        See Also:
        Break
      • getCrosshair

        public Crosshair getCrosshair()
        Get the crosshair config object for this axis.
        Returns:
        Crosshair config object, or create a new one if not set/disabled
        Since:
        2.1.1
        See Also:
        setCrosshair(Crosshair)
      • setCrosshair

        public void setCrosshair​(boolean crosshair)
        Enable crosshair with default values, or disable crosshair.
        Parameters:
        crosshair - true to enable, false to disable
        Since:
        2.1.1
        See Also:
        setCrosshair(Crosshair)
      • setCrosshair

        public void setCrosshair​(Crosshair crosshair)
        Set whether to enable crosshair for this axis or not.
        Parameters:
        crosshair -
        Since:
        2.1.1
        See Also:
        Crosshair
      • getHeight

        public String getHeight()
        Returns the height as the horizontal axis. If it's a number, it is interpreted as pixels.

        Default: undefined

        Since:
        10.2.1.0
      • setHeight

        public void setHeight​(String height)
        Sets the height as the horizontal axis. If it's a number, it is interpreted as pixels.

        Default: undefined

        Since:
        10.2.1.0
      • getLeft

        public Object getLeft()
        Returns the left position as the horizontal axis. If it's a number, it is interpreted as pixel position relative to the chart.

        Default: undefined

        Since:
        10.2.1.0
      • setLeft

        public void setLeft​(String left)
        Sets the left position as the horizontal axis. If it's a number, it is interpreted as pixel position relative to the chart.

        Default: undefined

        Since:
        10.2.1.0
      • setLeft

        public void setLeft​(Number left)
        Sets the left position as the horizontal axis. If it's a number, it is interpreted as pixel position relative to the chart.

        Default: undefined

        Since:
        10.2.1.0
      • getLineColor

        public Color getLineColor()
        Returns the color of the line marking the axis itself.

        Default: "#C0D0E0".

      • setLineColor

        public void setLineColor​(Color color)
        Sets the color of the line marking the axis itself.
      • setLineColor

        public void setLineColor​(String color)
        Sets the color of the line marking the axis itself.
      • setLineColor

        public void setLineColor​(LinearGradient color)
        Sets the color of the line marking the axis itself.
      • setLineColor

        public void setLineColor​(RadialGradient color)
        Sets the color of the line marking the axis itself.
      • getLineWidth

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

        Default: 1.

      • setLineWidth

        public void setLineWidth​(Number lineWidth)
        Sets the width of the line marking the axis itself.
      • isShowEmpty

        public boolean isShowEmpty()
        Returns whether to show the axis line and title when the axis has no data.

        Default: true.

      • setShowEmpty

        public void setShowEmpty​(boolean showEmpty)
        Sets whether to show the axis line and title when the axis has no data.
      • getTop

        public Object getTop()
        Returns the top position as the horizontal axis. If it's a number, it is interpreted as pixel position relative to the chart.

        Default: undefined

        Since:
        10.2.1.0
      • setTop

        public void setTop​(String top)
        Sets the top position as the horizontal axis. If it's a number, it is interpreted as pixel position relative to the chart.

        Default: undefined

        Since:
        10.2.1.0
      • setTop

        public void setTop​(Number top)
        Sets the top position as the horizontal axis. If it's a number, it is interpreted as pixel position relative to the chart.

        Default: undefined

        Since:
        10.2.1.0
      • getWidth

        public String getWidth()
        Returns the width as the horizontal axis. If it's a number, it is interpreted as pixels.

        Default: undefined

        Since:
        10.2.1.0
      • setWidth

        public void setWidth​(String width)
        Sets the width as the horizontal axis. If it's a number, it is interpreted as pixels.

        Default: undefined

        Since:
        10.2.1.0