public class XAxis extends Axis<XAxis>
BaseChart.getXAxis() method to gain a reference to this
object. Example usage:
XAxis xAxis = chart.getXAxis()
.setType(Axis.Type.DATE_TIME)
.setStartOfWeek(Axis.WeekDay.SUNDAY)
.setAxisTitleText("Year")
.setAlternateGridColor("#CCCCCC");
| Modifier and Type | Class and Description |
|---|---|
static class |
XAxis.TickmarkPlacement
An enumeration of supported tickmark placements for when categories are in use, which can be passed to
the
setTickmarkPlacement(XAxis.TickmarkPlacement) method. |
Axis.TickPosition, Axis.Type, Axis.WeekDay| Modifier and Type | Method and Description |
|---|---|
XAxis |
setCategories(boolean redraw,
String... categories)
Sets category names to use for the xAxis (instead of using numbers), explicitly controlling whether
or not the axis will be redrawn in the case that the chart has already been rendered to the DOM.
|
XAxis |
setCategories(String... categories)
Sets category names to use for the xAxis (instead of using numbers).
|
XAxis |
setLabels(XAxisLabels labels)
Convenience method for setting the 'labels' options of the axis.
|
XAxis |
setTickmarkPlacement(XAxis.TickmarkPlacement tickmarkPlacement)
Convenience method for setting the 'tickmarkPlacement' option for the axis.
|
addPlotBands, addPlotLines, createPlotBand, createPlotLine, getAxisSetExtremesEventHandler, getExtremes, getNativeAxis, removePlotBand, removePlotLine, setAllowDecimals, setAlternateGridColor, setAxisSetExtremesEventHandler, setAxisTitle, setAxisTitle, setAxisTitleText, setAxisTitleText, setDateTimeLabelFormats, setEndOnTick, setExtremes, setExtremes, setExtremes, setGridLineColor, setGridLineDashStyle, setGridLineWidth, setLineColor, setLineWidth, setLinkedTo, setMax, setMaxPadding, setMaxZoom, setMin, setMinorGridLineColor, setMinorGridLineDashStyle, setMinorGridLineWidth, setMinorTickColor, setMinorTickInterval, setMinorTickIntervalAuto, setMinorTickLength, setMinorTickPosition, setMinorTickWidth, setMinPadding, setOffset, setOpposite, setPlotBands, setPlotLines, setReversed, setShowEmpty, setShowFirstLabel, setShowLastLabel, setStartOfWeek, setStartOnTick, setTickColor, setTickInterval, setTickLength, setTickPixelInterval, setTickPosition, setTickWidth, setType, update, updategetOptions, setOptionpublic XAxis setCategories(String... categories)
setCategories(boolean, String...) method instead.categories - An array of category names to use for the axis.XAxis instance for convenient method chaining.public XAxis setCategories(boolean redraw, String... categories)
redraw - Whether to redraw the axis or wait for an explicit call to BaseChart.redraw()categories - An array of category names to use for the axis.XAxis instance for convenient method chaining.public XAxis setLabels(XAxisLabels labels)
axis.setOption("/labels/align", Labels.Align.LEFT);
axis.setOption("/labels/enabled", true);
etc...
Configuration object for the axis labels, usually displaying the number for each tick.
Example usage:
axis.setLabels(
new XAxisLabels()
.setAlign(Labels.Align.LEFT)
.setEnabled(true)
);
labels - The configuration object for the axis labels, or null to use the defaults.XAxis instance for convenient method chaining.public XAxis setTickmarkPlacement(XAxis.TickmarkPlacement tickmarkPlacement)
labels.setOption("tickmarkPlacement", TickmarkPlacement.ON);
For categorized axes only. If XAxis.TickmarkPlacement.ON the tick mark is placed in the center of the category,
if XAxis.TickmarkPlacement.BETWEEN the tick mark is placed between categories. Defaults to XAxis.TickmarkPlacement.BETWEEN.tickmarkPlacement - Whether or not to place the tickmark in the center or between categories.Axis instance for convenient method chaining.Copyright © 2015. All Rights Reserved.