Class WAxis


public class WAxis
extends java.lang.Object
Class which represents an axis of a cartesian chart.

A cartesian chart has two or three axes: an X axis (Axis.XAxis), a Y axis (Axis.YAxis) and optionally a second Y axis (Axis.Y2Axis). Each of the up to three axes in a cartesian chart has a unique getId() that identifies which of these three axes it is in the enclosing chart().

Use setVisible() to change the visibility of an axis, setGridLinesEnabled() to show grid lines for an axis. The pen styles for rendering the axis or grid lines may be changed using setPen() and setGridLinesPen(). A margin between the axis and the main plot area may be configured using setMargin().

By default, the axis will automatically adjust its range so that all data will be visible. You may manually specify a range using setMinimum(), setMaximum or setRange(). The interval between labels is by default automatically adjusted depending on the axis length and the range, but may be manually specified using setLabelInterval().

The axis has support for being "broken", to support displaying data with a few outliers which would otherwise swamp the chart. This is not done automatically, but instead you need to use setBreak() to specify the value range that needs to be omitted from the axis. The omission is rendered in the axis and in bars that cross the break.

The labels are shown using a "%.4g" format string for numbers, and a suitable format for AxisScale.DateScale or AxisScale.DateTimeScale scales, based on heuristics. The format may be customized using setLabelFormat(). The angle of the label text may be changed using setLabelAngle(). By default, all labels are printed horizontally.

See Also: