Package org.zkoss.chart
Class XAxis
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Axis
-
- org.zkoss.chart.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
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description XAxis()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Break>
getBreaks()
Get the list of breaks defined for this axis.Crosshair
getCrosshair()
Get the crosshair config object for this axis.String
getHeight()
Returns the height as the horizontal axis.Object
getLeft()
Returns the left position as the horizontal axis.Color
getLineColor()
Returns the color of the line marking the axis itself.Number
getLineWidth()
Returns the width of the line marking the axis itself.Object
getTop()
Returns the top position as the horizontal axis.String
getWidth()
Returns the width as the horizontal axis.boolean
isShowEmpty()
Returns whether to show the axis line and title when the axis has no data.void
setBreaks(List<Break> breaks)
Set the list of breaks defined for this axis.void
setCrosshair(boolean crosshair)
Enable crosshair with default values, or disable crosshair.void
setCrosshair(Crosshair crosshair)
Set whether to enable crosshair for this axis or not.void
setHeight(String height)
Sets the height as the horizontal axis.void
setLeft(Number left)
Sets the left position as the horizontal axis.void
setLeft(String left)
Sets the left position as the horizontal axis.void
setLineColor(String color)
Sets the color of the line marking the axis itself.void
setLineColor(Color color)
Sets the color of the line marking the axis itself.void
setLineColor(LinearGradient color)
Sets the color of the line marking the axis itself.void
setLineColor(RadialGradient color)
Sets the color of the line marking the axis itself.void
setLineWidth(Number lineWidth)
Sets the width of the line marking the axis itself.void
setShowEmpty(boolean showEmpty)
Sets whether to show the axis line and title when the axis has no data.void
setTop(Number top)
Sets the top position as the horizontal axis.void
setTop(String top)
Sets the top position as the horizontal axis.void
setWidth(String width)
Sets the width as the horizontal axis.-
Methods inherited from class org.zkoss.chart.Axis
addPlotBand, addPlotLine, getAccessibility, getAlternateGridColor, getAngle, getCategories, getCeiling, getClassName, getCrossing, getDateTimeLabelFormats, getFloor, getGridLineColor, getGridLineDashStyle, getGridLineWidth, getGridZIndex, getId, getLabels, getLinkedTo, getMargin, getMax, getMaxPadding, getMin, getMinorGridLineColor, getMinorGridLineDashStyle, getMinorGridLineWidth, getMinorTickColor, getMinorTickInterval, getMinorTickLength, getMinorTickPosition, getMinorTicksPerMajor, getMinorTickWidth, getMinPadding, getMinRange, getMinTickInterval, getOffset, getPane, getPlotBands, getPlotLines, getSoftMax, getSoftMin, getStartOfWeek, getTickAmount, getTickColor, getTickInterval, getTickLength, getTickmarkPlacement, getTickPixelInterval, getTickPosition, getTickPositions, getTickWidth, getTitle, getType, getZIndex, isAlignTicks, isAllowDecimals, isAllowNegativeLog, isEndOnTick, isMinorTicks, isOpposite, isPanningEnabled, isReversed, isReversedStacks, isShowFirstLabel, isShowLastLabel, isStartOnTick, isUniqueNames, isVisible, isZoomEnabled, onChange, remove, removePlotBand, removePlotBand, removePlotLine, removePlotLine, setAccessibility, setAlignTicks, setAllowDecimals, setAllowNegativeLog, setAlternateGridColor, setAlternateGridColor, setAlternateGridColor, setAlternateGridColor, setAngle, setCategories, setCategories, setCeiling, setClassName, setCrossing, setDateTimeLabelFormats, setEndOnTick, setExtremes, setExtremes, setFloor, setGridLineColor, setGridLineColor, setGridLineColor, setGridLineColor, setGridLineDashStyle, setGridLineWidth, setGridZIndex, setId, setLabels, setLinkedTo, setMargin, setMax, setMaxPadding, setMin, setMinorGridLineColor, setMinorGridLineColor, setMinorGridLineColor, setMinorGridLineColor, setMinorGridLineDashStyle, setMinorGridLineWidth, setMinorTickColor, setMinorTickColor, setMinorTickColor, setMinorTickColor, setMinorTickInterval, setMinorTickInterval, setMinorTickLength, setMinorTickPosition, setMinorTicks, setMinorTicksPerMajor, setMinorTickWidth, setMinPadding, setMinRange, setMinTickInterval, setOffset, setOpposite, setPane, setPanningEnabled, setPlotBands, setPlotBands, setPlotLines, setPlotLines, setReversed, setReversedStacks, setShowFirstLabel, setShowLastLabel, setSoftMax, setSoftMin, setStartOfWeek, setStartOnTick, setTickAmount, setTickColor, setTickInterval, setTickLength, setTickmarkPlacement, setTickPixelInterval, setTickPosition, setTickPositions, setTickWidth, setTitle, setTitle, setType, setUniqueNames, setVisible, setZIndex, setZoomEnabled
-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
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
-
-