org.moxieapps.gwt.highcharts.client.labels
Class XAxisLabels
java.lang.Object
org.moxieapps.gwt.highcharts.client.Configurable<T>
org.moxieapps.gwt.highcharts.client.labels.Labels<XAxisLabels>
org.moxieapps.gwt.highcharts.client.labels.XAxisLabels
public class XAxisLabels
- extends Labels<XAxisLabels>
Represents the configuration options that can be set for the labels on the x-axis of a chart, and
can then be passed to the XAxis.setLabels(org.moxieapps.gwt.highcharts.client.labels.XAxisLabels)
method. Example usage:
chart.getXAxis().setLabels(
new XAxisLabels()
.setAlign(Labels.Align.LEFT)
.setColor("#CC0000")
);
- Since:
- 1.0.0
- Author:
- squinn@moxiegroup.com (Shawn Quinn)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XAxisLabels
public XAxisLabels()
setFormatter
public XAxisLabels setFormatter(AxisLabelsFormatter axisLabelsFormatter)
- Sets a custom formatter for the labels on the axis that can be used to control how the text of the
labels will be displayed. See the
AxisLabelsFormatter
interface, and
in particular the AxisLabelsFormatter.format(AxisLabelsData)
method for more details on
the capabilities available to custom formatters.
- Parameters:
axisLabelsFormatter
- The custom formatter to use for the labels (if not given a built-in
generic formatter is used which simply returns the value as a string).
- Returns:
- A reference to this
XAxisLabels
instance for convenient method chaining.
getFormatter
public AxisLabelsFormatter getFormatter()
- Returns the custom axis labels formatter that has been applied to the x-axis, or null if the
built-in generic formatter is being used instead.
- Returns:
- The custom axis labels formatter that has been applied to the x-axis, or null if it has not been set.
setStaggerLines
public XAxisLabels setStaggerLines(Number staggerLines)
- Convenience method for setting the 'staggerLines' option for the labels. Equivalent to:
xAxisLabels.setOption("staggerLines", 2);
Horizontal axes only. The number of lines to spread the labels over to make room or tighter labels. Defaults to null.
- Parameters:
staggerLines
- The number of lines to spread the labels over to make room or tighter labels.
- Returns:
- A reference to this
XAxisLabels
instance for convenient method chaining.
setStep
public XAxisLabels setStep(Number step)
- Convenience method for setting the 'step' option for the labels. Equivalent to:
xAxisLabels.setOption("step", 2);
To show only every n'th label on the axis, set the step to n. E.g. - setting the step to
2 shows every other label. Defaults to null.
- Parameters:
step
- o show only every n'th label on the axis, set the step to n.
- Returns:
- A reference to this
XAxisLabels
instance for convenient method chaining.
Copyright © 2015. All Rights Reserved.