|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.moxieapps.gwt.highcharts.client.Configurable<T>
org.moxieapps.gwt.highcharts.client.Axis<T>
public abstract class Axis<T extends Axis>
The base class for both the X and Y axis types, which allows for general options to be set via
the inherited Configurable.setOption(String, Object)
method. But also exposes type
specific methods that the caller is encouraged to use instead, such as
setAllowDecimals(boolean)
, setAlternateGridColor(String)
, etc.
XAxis
or YAxis
.
Nested Class Summary | |
---|---|
static class |
Axis.TickPosition
An enumeration of supported tick positions, which can be passed to methods such as setMinorTickPosition(Axis.TickPosition) and setTickPosition(Axis.TickPosition) |
static class |
Axis.Type
An enumeration of supported axis types, which can be passed to methods such as setType(Axis.Type) . |
static class |
Axis.WeekDay
An enumeration of supported week days, which can be passed to methods such as setStartOfWeek(Axis.WeekDay) . |
Method Summary | |
---|---|
T |
addPlotBands(PlotBand... plotBands)
Allows plot bands to be added to an axis after the chart is rendered. |
T |
addPlotLines(PlotLine... plotLines)
Allows plot lines to be added to an axis after the chart is rendered. |
PlotBand |
createPlotBand()
Create a new plot band that can be configured, and then added to this axis instance via the setPlotBands(PlotBand...) method. |
PlotLine |
createPlotLine()
Create a new plot line that can be configured, and then added to this axis instance via the setPlotLines(PlotLine...) method. |
AxisSetExtremesEventHandler |
getAxisSetExtremesEventHandler()
Returns the custom event handler that has been set on the axis, or null if no event handler has been set. |
Extremes |
getExtremes()
Return a non-null object that represents the current extremes for the axis. |
com.google.gwt.core.client.JavaScriptObject |
getNativeAxis()
Returns a pointer to the native Highchart's Axis instance that this GWT Axis instance is associated with. |
T |
removePlotBand(PlotBand plotBand)
Remove the given plot band from the chart after it has been rendered, automatically redrawing the chart after the plot band has been removed. |
T |
removePlotLine(PlotLine plotLine)
Remove the given plot line from the chart after it has been rendered, automatically redrawing the chart after the plot line has been removed. |
T |
setAllowDecimals(boolean allowDecimals)
Convenience method for setting the 'allowDecimals' option for the axis. |
T |
setAlternateGridColor(String alternateGridColor)
Convenience method for setting the 'alternateGridColor' option for the axis. |
T |
setAxisSetExtremesEventHandler(AxisSetExtremesEventHandler axisSetExtremesEventHandler)
Set a callback handler that will be invoked whenever the minimum and maximum is set for the axis, either by calling the setExtremes(Number, Number) method or by selecting an area in the chart. |
T |
setAxisTitle(AxisTitle title)
Convenience method for setting the 'title/text' axis option, before or after the chart is rendered. |
T |
setAxisTitle(AxisTitle title,
boolean redraw)
Convenience method for setting the 'title/text' axis option, before or after the chart is rendered (explicitly controlling whether or not the new title will be immediately drawn in the case of being called after the chart is rendered). |
T |
setAxisTitleText(String title)
Convenience method for setting the 'title/text' axis option, before or after the chart is rendered. |
T |
setAxisTitleText(String title,
boolean redraw)
Convenience method for setting the 'title/text' axis option, before or after the chart is rendered (explicitly controlling whether or not the new title will be immediately drawn in the case of being called after the chart is rendered). |
T |
setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
Convenience method for setting the 'dateTimeLabelFormats' options of the axis. |
T |
setEndOnTick(boolean endOnTick)
Convenience method for setting the 'endOnTick' option for the axis. |
T |
setExtremes(Number min,
Number max)
Set the minimum and maximum of the axes after render time using the default animation options. |
T |
setExtremes(Number min,
Number max,
boolean redraw,
Animation animation)
Set the minimum and maximum of the axes after render time, controlling the redraw and animation options. |
T |
setExtremes(Number min,
Number max,
boolean redraw,
boolean animation)
Set the minimum and maximum of the axes after render time, controlling the redraw and animation status. |
T |
setGridLineColor(String gridLineColor)
Convenience method for setting the 'gridLineColor' option for the axis. |
T |
setGridLineDashStyle(PlotLine.DashStyle gridLineDashStyle)
Convenience method for setting the 'gridLineDashStyle' axis option. |
T |
setGridLineWidth(Number gridLineWidth)
Convenience method for setting the 'gridLineWidth' option for the axis. |
T |
setLineColor(String lineColor)
Convenience method for setting the 'lineColor' option for the axis. |
T |
setLineWidth(Number lineWidth)
Convenience method for setting the 'lineWidth' option for the axis. |
T |
setLinkedTo(Number linkedTo)
Convenience method for setting the 'linkedTo' option for the axis. |
T |
setMax(Number max)
Convenience method for setting the 'max' option for the axis. |
T |
setMaxPadding(Number maxPadding)
Convenience method for setting the 'maxPadding' option for the axis. |
T |
setMaxZoom(Number maxZoom)
Convenience method for setting the 'maxZoom' option for the axis. |
T |
setMin(Number min)
Convenience method for setting the 'min' option for the axis. |
T |
setMinorGridLineColor(String minorGridLineColor)
Convenience method for setting the 'minorGridLineColor' option for the axis. |
T |
setMinorGridLineDashStyle(PlotLine.DashStyle minorGridLineDashStyle)
Convenience method for setting the 'minorGridLineDashStyle' axis option. |
T |
setMinorGridLineWidth(Number minorGridLineWidth)
Convenience method for setting the 'minorGridLineWidth' option for the axis. |
T |
setMinorTickColor(String minorTickColor)
Convenience method for setting the 'minorTickColor' option for the axis. |
T |
setMinorTickInterval(Number minorTickInterval)
Convenience method for setting the 'minorTickInterval' option for the axis. |
T |
setMinorTickIntervalAuto()
Convenience method for setting the 'minorTickInterval' option for the axis to auto. |
T |
setMinorTickLength(Number minorTickLength)
Convenience method for setting the 'minorTickLength' option for the axis. |
T |
setMinorTickPosition(Axis.TickPosition minorTickPosition)
Convenience method for setting the 'minorTickPosition' option for the axis. |
T |
setMinorTickWidth(Number minorTickWidth)
Convenience method for setting the 'minorTickWidth' option for the axis. |
T |
setMinPadding(Number minPadding)
Convenience method for setting the 'minPadding' option for the axis. |
T |
setOffset(Number offset)
Convenience method for setting the 'offset' option for the axis. |
T |
setOpposite(boolean opposite)
Convenience method for setting the 'opposite' option for the axis. |
T |
setPlotBands(PlotBand... plotBands)
Sets the 'plotBands' array for the axis. |
T |
setPlotLines(PlotLine... plotLines)
Sets the 'plotLines' array for the axis. |
T |
setReversed(boolean reversed)
Convenience method for setting the 'reversed' option for the axis. |
T |
setShowEmpty(boolean showEmpty)
Convenience method for setting the 'showEmpty' option for the axis. |
T |
setShowFirstLabel(boolean showFirstLabel)
Convenience method for setting the 'showFirstLabel' option for the axis. |
T |
setShowLastLabel(boolean showLastLabel)
Convenience method for setting the 'showLastLabel' option for the axis. |
T |
setStartOfWeek(Axis.WeekDay startOfWeek)
Convenience method for setting the 'startOfWeek' option for the axis. |
T |
setStartOnTick(boolean startOnTick)
Convenience method for setting the 'startOnTick' option for the axis. |
T |
setTickColor(String tickColor)
Convenience method for setting the 'tickColor' option for the axis. |
T |
setTickInterval(Number tickInterval)
Convenience method for setting the 'tickInterval' option for the axis. |
T |
setTickLength(Number tickLength)
Convenience method for setting the 'tickLength' option for the axis. |
T |
setTickPixelInterval(Number tickPixelInterval)
Convenience method for setting the 'tickPixelInterval' option for the axis. |
T |
setTickPosition(Axis.TickPosition tickPosition)
Convenience method for setting the 'tickPosition' option for the axis. |
T |
setTickWidth(Number tickWidth)
Convenience method for setting the 'tickWidth' option for the axis. |
T |
setType(Axis.Type type)
Convenience method for setting the 'type' axis option. |
T |
update(Axis axisOptions)
Update an axis object with a new set of options. |
T |
update(Axis axisOptions,
boolean redraw)
Update an axis object with a new set of options. |
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable |
---|
getOptions, setOption |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public T setAxisSetExtremesEventHandler(AxisSetExtremesEventHandler axisSetExtremesEventHandler)
setExtremes(Number, Number)
method or by selecting an area in the chart.
Additional information about the new extremes value (such as the new minimum and maximum) can be
found via the AxisSetExtremesEvent
instance
that is passed to the handler's AxisSetExtremesEventHandler.onSetExtremes(org.moxieapps.gwt.highcharts.client.events.AxisSetExtremesEvent)
method.
axisSetExtremesEventHandler
- The handler that should be invoked whenever a set extremes event occurs.
Axis
instance for convenient method chaining.public AxisSetExtremesEventHandler getAxisSetExtremesEventHandler()
public PlotLine createPlotLine()
setPlotLines(PlotLine...)
method.
setPlotLines(PlotLine...)
.public PlotBand createPlotBand()
setPlotBands(PlotBand...)
method.
setPlotBands(PlotBand...)
.public T setAllowDecimals(boolean allowDecimals)
axis.setOption("allowDecimals", false);
Whether to allow decimals in this axis' ticks. When counting integers, like persons or
hits on a web page, decimals must be avoided in the axis tick labels. Defaults to true.
allowDecimals
- Whether to allow decimals in this axis' ticks.
Axis
instance for convenient method chaining.public T setAlternateGridColor(String alternateGridColor)
axis.setOption("alternateGridColor", "#CC0000");
When using an alternate grid color, a band is painted across the plot area between every
other grid line. Defaults to null.
alternateGridColor
- The color to use as the alternate grid color.
Axis
instance for convenient method chaining.public T setDateTimeLabelFormats(DateTimeLabelFormats dateTimeLabelFormats)
axis.setOption("/dateTimeLabelFormats/second", "%H:%M:%S");
axis.setOption("/dateTimeLabelFormats/minute", "%H:%M");
For a datetime axis, the scale will automatically adjust to the appropriate unit. This configuration
option sets the default string format representations used for each unit. For an overview of the
replacement codes available see the javadoc on the DateTimeLabelFormats
class. Defaults to:
axis.setDateTimeLabelFormats(
new DateTimeLabelFormats()
.setHour("%I %p")
.setMinute("%I:%M %p")
);
dateTimeLabelFormats
- The formats to use for time series information on this axis.
Axis
instance for convenient method chaining.public T setEndOnTick(boolean endOnTick)
axis.setOption("endOnTick", true);
Whether to force the axis to end on a tick. Use this option with the maxPadding option to
control the axis end. Defaults to false.
endOnTick
- Whether to force the axis to end on a tick.
Axis
instance for convenient method chaining.public T setExtremes(Number min, Number max)
setExtremes(Number, Number, boolean, boolean)
or setExtremes(Number, Number, boolean, Animation)
method instead.
min
- The new minimum value.max
- The new maximum value.
Axis
instance for convenient method chaining.public T setExtremes(Number min, Number max, boolean redraw, boolean animation)
setExtremes(Number, Number, boolean, Animation)
method instead.
min
- The new minimum value.max
- The new maximum value.redraw
- 'true' to force the chart to redraw immediately, or 'false' to wait until the
BaseChart.redraw()
method is invoked.animation
- When 'true', the chart updating will be animated with default animation options.
Note, use the setExtremes(Number, Number, boolean, Animation)
method
for more control over the animation options.
Axis
instance for convenient method chaining.public T setExtremes(Number min, Number max, boolean redraw, Animation animation)
setExtremes(Number, Number)
or setExtremes(Number, Number, boolean, boolean)
method instead.
min
- The new minimum value.max
- The new maximum value.redraw
- 'true' to force the chart to redraw immediately, or 'false' to wait until the
BaseChart.redraw()
method is invoked.animation
- Custom animation to use when the chart extremes are being updated.
Axis
instance for convenient method chaining.public Extremes getExtremes()
public com.google.gwt.core.client.JavaScriptObject getNativeAxis()
public T setGridLineColor(String gridLineColor)
axis.setOption("gridLineColor", "#CCCCCC");
Color of the grid lines extending the ticks across the plot area. Defaults to "#C0C0C0".
gridLineColor
- Color of the grid lines extending the ticks across the plot area.
Axis
instance for convenient method chaining.public T setGridLineDashStyle(PlotLine.DashStyle gridLineDashStyle)
plotOptions.setOption("gridLineDashStyle", PlotOptions.DashStyle.LONG_DASH);
The dash or dot style of the grid lines. Defaults to DashStyle.DOT. See this
demonstration for a visible reference
of the available dash styles.
gridLineDashStyle
- Sets the dash or dot style of the grid lines, or null to return to the default.
Axis
instance for convenient method chaining.public T setGridLineWidth(Number gridLineWidth)
axis.setOption("gridLineWidth", 2);
The width of the grid lines extending the ticks across the plot area. Defaults to 0.
gridLineWidth
- The new width of the grid lines extending the ticks across the plot area.
Axis
instance for convenient method chaining.public T setLineColor(String lineColor)
axis.setOption("lineColor", "#00CC00");
The color of the line marking the axis itself. Defaults to "#C0D0E0".
lineColor
- The new color of the line marking the axis itself.
Axis
instance for convenient method chaining.public T setLineWidth(Number lineWidth)
axis.setOption("lineWidth", 2);
The width of the line marking the axis itself. Defaults to 1.
lineWidth
- The new width of the line marking the axis itself.
Axis
instance for convenient method chaining.public T setLinkedTo(Number linkedTo)
axis.setOption("linkedTo", 2);
Index of another axis that this axis is linked to. When an axis is linked to a master
axis, it will take the same extremes as the master, but as assigned by
setMin(Number)
or setMax(Number)
or
by setExtremes(Number, Number)
. It can be used to show additional info, or
to ease reading the chart by duplicating the scales. Defaults to null.
linkedTo
- The index of another axis that this axis is linked to.
Axis
instance for convenient method chaining.public T setMax(Number max)
axis.setOption("max", 100);
The maximum value of the axis. If null, the max value is automatically calculated. If
the setEndOnTick(boolean)
option is true, the max value might be rounded up.
The actual maximum value is also influenced by BaseChart.setAlignTicks(boolean)
setting. Defaults to null.
Note that this method will only affect the maximum value of the chart before it is rendered.
To change the min/max value of the chart after render time use the setExtremes(Number, Number)
method instead.
max
- The maximum value of the axis, or null to automatically calculate the maximum.
Axis
instance for convenient method chaining.public T setMaxPadding(Number maxPadding)
axis.setOption("maxPadding", 0.05);
Padding of the max value relative to the length of the axis. A padding of 0.05 will make a
100px axis 5px longer. This is useful when you don't want the highest data value to appear
on the edge of the plot area. When the axis' max option is set or a max extreme is set
using setExtremes(Number, Number)
, the maxPadding will be ignored. Defaults to 0.01.
maxPadding
- The new padding of the max value relative to the length of the axis.
Axis
instance for convenient method chaining.public T setMaxZoom(Number maxZoom)
axis.setOption("maxZoom", 5);
The maximum amount of zoom on this axis. The entire axis will not be allowed to span over
a smaller interval than this. For example, for a datetime axis the main unit is milliseconds.
If maxZoom is set to 3600000, you can't zoom in more than to one hour.
maxZoom
- The new maximum amount of zoom on this axis.
Axis
instance for convenient method chaining.public T setMin(Number min)
axis.setOption("min", 10);
The minimum value of the axis. If null, the min value is automatically calculated. If
the setStartOnTick(boolean)
option is true, the min value might be rounded down.
Defaults to null.
Note that this method will only affect the minimum value of the chart before it is rendered.
To change the min/max value of the chart after render time use the setExtremes(Number, Number)
method instead.
min
- The minimum value of the axis, or null to automatically calculate the minimum.
Axis
instance for convenient method chaining.public T setMinorGridLineColor(String minorGridLineColor)
axis.setOption("minorGridLineColor", "#00CC00");
Color of the minor, secondary grid lines. Defaults to #E0E0E0.
minorGridLineColor
- The new color of the minor, secondary grid lines.
Axis
instance for convenient method chaining.public T setMinorGridLineDashStyle(PlotLine.DashStyle minorGridLineDashStyle)
plotOptions.setOption("minorGridLineDashStyle", PlotOptions.DashStyle.LONG_DASH);
The dash or dot style of the grid lines. Defaults to DashStyle.SOLID. See this
demonstration for a visible reference
of the available dash styles.
minorGridLineDashStyle
- Sets the dash or dot style of the minor grid lines, or null to return to the default.
Axis
instance for convenient method chaining.public T setMinorGridLineWidth(Number minorGridLineWidth)
axis.setOption("minorGridLineWidth", 2);
The width of the minor, secondary grid lines. Defaults to 1.
minorGridLineWidth
- The new width of the minor, secondary grid lines.
Axis
instance for convenient method chaining.public T setMinorTickColor(String minorTickColor)
axis.setOption("minorTickColor", "#00CC00");
Color for the minor tick marks. Defaults to #A0A0A0.
minorTickColor
- The new color for the minor tick marks.
Axis
instance for convenient method chaining.public T setMinorTickInterval(Number minorTickInterval)
axis.setOption("minorTickInterval", 2);
Tick interval in scale units for the minor ticks. If null, minor ticks are not shown. Defaults to null.
Note that if you instead call the setMinorTickIntervalAuto()
method
the minor tick interval is calculated as a fifth of the tickInterval.
minorTickInterval
- The new tick interval in scale units for the minor ticks.
Axis
instance for convenient method chaining.public T setMinorTickIntervalAuto()
axis.setOption("minorTickInterval", "auto");
Note, if you instead want to set the tick interval to a specific numeric value (or disable the
ticks completely), you'll want to use the setMinorTickInterval(Number)
method.
Axis
instance for convenient method chaining.public T setMinorTickLength(Number minorTickLength)
axis.setOption("minorTickLength", 4);
The pixel length of the minor tick marks. Defaults to 2.
minorTickLength
- The new pixel length of the minor tick marks.
Axis
instance for convenient method chaining.public T setMinorTickPosition(Axis.TickPosition minorTickPosition)
axis.setOption("minorTickPosition", TickPosition.INSIDE);
The position of the minor tick marks relative to the axis line. Defaults to Axis.TickPosition.OUTSIDE
.
minorTickPosition
- The new position of the minor tick marks relative to the axis line,
or null to return to the default.
Axis
instance for convenient method chaining.public T setMinorTickWidth(Number minorTickWidth)
axis.setOption("minorTickWidth", 4);
The pixel width of the minor tick mark. Defaults to 0.
minorTickWidth
- The new pixel width of the minor tick mark.
Axis
instance for convenient method chaining.public T setMinPadding(Number minPadding)
axis.setOption("minPadding", 0.05);
Padding of the min value relative to the length of the axis. A padding of 0.05 will make a
100px axis 5px longer. This is useful when you don't want the highest data value to appear
on the edge of the plot area. When the axis' min option is set or a max extreme is set
using setExtremes(Number, Number)
, the minPadding will be ignored. Defaults to 0.01.
minPadding
- The new padding of the min value relative to the length of the axis.
Axis
instance for convenient method chaining.public T setOffset(Number offset)
axis.setOption("offset", 60);
The distance in pixels from the plot area to the axis line. A positive offset moves
the axis with it's line, labels and ticks away from the plot area. This is typically
used when two or more axes are displayed on the same side of the plot. Defaults to 0.
offset
- The new distance in pixels from the plot area to the axis line.
Axis
instance for convenient method chaining.public T setOpposite(boolean opposite)
axis.setOption("opposite", true);
Whether to display the axis on the opposite side of the normal. The normal is on the
left side for vertical axes and bottom for horizontal, so the opposite sides will be
right and top respectively. This is typically used with dual or multiple axes. Defaults to false.
opposite
- 'true' to display the axis on the opposite side of the normal, 'false'
to show the axis on the normal side.
Axis
instance for convenient method chaining.public T setPlotLines(PlotLine... plotLines)
XAxis xAxis = chart.getXAxis()
xAxis.getXAxis()
.setPlotLines(
xAxis.createPlotLine()
.setColor("#CC0000")
.setValue(40),
xAxis.createPlotLine()
.setColor("#009900")
.setValue(60)
)
);
plotLines
- One or more PlotLine instances that represent the options of each line to render
Axis
instance for convenient method chaining.public T setPlotBands(PlotBand... plotBands)
XAxis xAxis = chart.getXAxis()
.setPlotBands(
xAxis.createPlotBand()
.setColor("#CC0000")
.setFrom(40)
.setTo(80),
xAxis.createPlotBand()
.setColor("#009900")
.setFrom(90)
.setTo(120),
)
);
plotBands
- One or more PlotBand instances that represent the options of each band to render
Axis
instance for convenient method chaining.public T setReversed(boolean reversed)
axis.setOption("reversed", true);
Whether to reverse the axis so that the highest number is closest to origin. If the chart
is inverted, the x axis is reversed by default. Defaults to false.
reversed
- 'true' to reverse the axis so that the highest number is closest to origin, 'false'
to show the axis in its default orientation.
Axis
instance for convenient method chaining.public T setShowEmpty(boolean showEmpty)
axis.setOption("showEmpty", false);
Whether to show the axis line and title when the axis has no data. Defaults to true.
showEmpty
- 'true' to show the axis line when the axis has no data (default,) false
to hide the axis line when the series has no data
Axis
instance for convenient method chaining.public T setShowFirstLabel(boolean showFirstLabel)
axis.setOption("showFirstLabel", false);
Whether to show the first tick label. Defaults to true.
showFirstLabel
- 'true' to show the first tick label (the default), 'false' to hide it.
Axis
instance for convenient method chaining.public T setShowLastLabel(boolean showLastLabel)
axis.setOption("showLastLabel", true);
Whether to show the last tick label. Defaults to false.
showLastLabel
- 'true' to show the first tick label, 'false' to hide it (the default).
Axis
instance for convenient method chaining.public T setStartOfWeek(Axis.WeekDay startOfWeek)
axis.setOption("startOfWeek", WeekDay.SUNDAY);
For datetime axes, this decides where to put the tick between weeks. Defaults to 1 Axis.WeekDay.MONDAY
.
startOfWeek
- The day of the week where tick marks should be placed between weeks.
Axis
instance for convenient method chaining.public T setStartOnTick(boolean startOnTick)
axis.setOption("startOnTick", true);
Whether to force the axis to start on a tick. Use this option with the
setMaxPadding(Number)
option to control the axis start. Defaults to false.
startOnTick
- 'true' to force the axis to start on a tick, 'false' for the default behavior.
Axis
instance for convenient method chaining.public T setTickColor(String tickColor)
axis.setOption("tickColor", "#00CC00");
Color for the main tick marks. Defaults to #C0D0E0.
tickColor
- The new color for the main tick marks.
Axis
instance for convenient method chaining.public T setTickInterval(Number tickInterval)
axis.setOption("tickInterval", 5);
The interval of the tick marks in axis units. When null, the tick interval is computed to
approximately follow the tickPixelInterval on linear and datetime axes. On categorized axes, a
null tickInterval will default to 1, one category. Note that datetime axes are based on milliseconds,
so for example an interval of one day is expressed as 24 * 3600 * 1000. Defaults to null.
tickInterval
- The interval of the tick marks in axis units, or null to follow the default interval logic.
Axis
instance for convenient method chaining.public T setTickLength(Number tickLength)
axis.setOption("tickLength", 20);
The pixel length of the main tick marks. Defaults to 5.
tickLength
- The new pixel length of the main tick marks.
Axis
instance for convenient method chaining.public T setTickPixelInterval(Number tickPixelInterval)
axis.setOption("tickPixelInterval", 50);
If tickInterval is null (the default) this option sets the approximate pixel interval of the tick marks.
Not applicable to categorized axis. Defaults to 72 for the Y axis and 100 for the X axis.
tickPixelInterval
- The new approximate pixel interval of the tick marks.
Axis
instance for convenient method chaining.public T setTickPosition(Axis.TickPosition tickPosition)
axis.setOption("tickPosition", TickPosition.INSIDE);
The position of the major tick marks relative to the axis line. Defaults to Axis.TickPosition.OUTSIDE
.
tickPosition
- The new position of the major tick marks relative to the axis line.
Axis
instance for convenient method chaining.public T setTickWidth(Number tickWidth)
axis.setOption("tickWidth", 10);
The pixel width of the major tick marks. Defaults to 1.
tickWidth
- The new pixel width of the major tick marks.
Axis
instance for convenient method chaining.public T setAxisTitleText(String title)
axis.setOption("/title/text", "A Fine Axis Indeed");
After the chart is rendered this is equivalent to a direct JS call like
Axis.setTitle({text: "A Fine Axis Indeed"});
The actual text of the axis title. It can contain basic HTML text markup like
<b>, <i> and spans with style. Defaults to null for the x-axis
and "Y-values" for the y-axis.
Note that for more control over the title, utilize the setAxisTitle(AxisTitle)
method instead.
Also note that to hide an axis title completely, simply set the text to null.
title
- Sets the title of axis, or null to hide the title.
Axis
instance for convenient method chaining.public T setAxisTitleText(String title, boolean redraw)
axis.setOption("/title/text", "A Fine Axis Indeed");
After the chart is rendered this is equivalent to a JS call like:
Axis.setTitle({text: "A Fine Axis Indeed"}, true);
The actual text of the axis title. It can contain basic HTML text markup like
<b>, <i> and spans with style. Defaults to null for the x-axis
and "Y-values" for the y-axis.
Note that for more control over the title, utilize the setAxisTitle(AxisTitle)
method instead.
Also note that to hide an axis title completely, simply set the text to null.
title
- Sets the title of axis, or null to hide the title.redraw
- Whether to redraw the chart now or hold until the next BaseChart.redraw()
Axis
instance for convenient method chaining.public T setAxisTitle(AxisTitle title)
axis.setOption("/title/text", "A Fine Axis Indeed");
axis.setOption("/title/align", AxisTitle.Align.HIGH);
After the chart is rendered this is equivalent to a JS call like:
Axis.setTitle({text: "A Fine Axis Indeed", align: "high"});
Note that if you call this method it will overwrite any existing
settings that have already been applied to the title (e.g. if you
had previously called the setAxisTitleText(String)
method that change
will get overwritten by this call.)
Note that if you only want to change the text of the axis, you can simply
use the setAxisTitleText(String)
method instead.
title
- Sets the axis title options, or null to hide the title.
Axis
instance for convenient method chaining.public T setAxisTitle(AxisTitle title, boolean redraw)
axis.setOption("/title/text", "A Fine Axis Indeed");
axis.setOption("/title/align", AxisTitle.Align.HIGH);
After the chart is rendered this is equivalent to a JS call like:
Axis.setTitle({text: "A Fine Axis Indeed", align: "high"});
Note that if you call this method it will overwrite any existing
settings that have already been applied to the title (e.g. if you
had previously called the setAxisTitleText(String)
method that change
will get overwritten by this call.)
Note that if you only want to change the text of the axis, you can simply
use the setAxisTitleText(String)
method instead.
title
- Sets the axis title options, or null to hide the title.redraw
- Whether to redraw the chart now or hold until the next BaseChart.redraw()
Axis
instance for convenient method chaining.public T setType(Axis.Type type)
axis.setOption("type", Axis.Type.DATE_TIME);
The type of axis. Can be one of "linear" or "datetime". In a datetime axis, the numbers are
given in milliseconds, and tick marks are placed on appropriate values like full hours or days.
Defaults to Axis.Type.LINEAR
.
type
- Sets the type of axis.
Axis
instance for convenient method chaining.public T addPlotLines(PlotLine... plotLines)
setPlotLines(PlotLine...)
method instead.
plotLines
- One or more PlotLine instances that represent the options of each line to render
Axis
instance for convenient method chaining.public T addPlotBands(PlotBand... plotBands)
setPlotBands(PlotBand...)
method instead.
plotBands
- One or more PlotBand instances that represent the options of each band to render
Axis
instance for convenient method chaining.public T removePlotLine(PlotLine plotLine)
plotLine
- The PlotLine instance to remove from the chart.
Axis
instance for convenient method chaining.public T removePlotBand(PlotBand plotBand)
plotBand
- The PlotBand instance to remove from the chart.
Axis
instance for convenient method chaining.public T update(Axis axisOptions)
axisOptions
- The new options that will be merged in with existing options on the axis.
Axis
instance for convenient method chaining.public T update(Axis axisOptions, boolean redraw)
axisOptions
- The new options that will be merged in with existing options on the axis.redraw
- Defaults to true. Whether to redraw the chart after the new options are set.
Axis
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |