org.moxieapps.gwt.highcharts.client
Class YAxis

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<T>
      extended by org.moxieapps.gwt.highcharts.client.Axis<YAxis>
          extended by org.moxieapps.gwt.highcharts.client.YAxis

public class YAxis
extends Axis<YAxis>

Provides access to an object that can abe used to configure and manage the y-axis of the chart. Note that you can not instance an instance of this object directly, and instead should use the BaseChart.getYAxis() method to gain a reference to this object. Example usage:


 chart.getYAxis()
    .setType(Axis.Type.LINEAR)
    .setAxisTitleText("Sales")
    .setLineWidth(3);
 

Since:
1.0.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.moxieapps.gwt.highcharts.client.Axis
Axis.TickPosition, Axis.Type, Axis.WeekDay
 
Method Summary
 YAxis 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.
 YAxis setCategories(String... categories)
          Sets category names to use for the xAxis (instead of using numbers).
 YAxis setHeight(Number height)
          Convenience method for setting the 'top' option of the axis.
 YAxis setLabels(YAxisLabels labels)
          Convenience method for setting the 'labels' options of the axis.
 YAxis setStackLabels(StackLabels stackLabels)
          Convenience method for setting the 'stackLabels' options of the axis.
 YAxis setTop(Number top)
          Convenience method for setting the 'top' option of the axis.
 
Methods inherited from class org.moxieapps.gwt.highcharts.client.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, update
 
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

setCategories

public YAxis setCategories(String... categories)
Sets category names to use for the xAxis (instead of using numbers). If categories are present for the xAxis, names are used instead of numbers for that axis. Example: setCategories("Apples", "Bananas", "Oranges"). Defaults to an empty array, which will use numbers for the categories instead of names when categories are present.

Note that this method will automatically redraw the categories on the chart if invoked after the chart has been rendered. For more control over when the categories are redrawn, you can utilize the setCategories(boolean, String...) method instead.

Parameters:
categories - An array of category names to use for the axis.
Returns:
A reference to this XAxis instance for convenient method chaining.

setCategories

public YAxis 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. If categories are present for the xAxis, names are used instead of numbers for that axis. Example: setCategories("Apples", "Bananas", "Oranges"). Defaults to an empty array, which will use numbers for the categories instead of names when categories are present.

Parameters:
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.
Returns:
A reference to this XAxis instance for convenient method chaining.
Since:
1.1.1

setHeight

public YAxis setHeight(Number height)
Convenience method for setting the 'top' option of the axis. Equivalent to:

     axis.setOption("top", 300);
 
The maximum value of the axis

Parameters:
height - The height of the axis.
Returns:
A reference to this YAxis instance for convenient method chaining.
Since:
1.6.0

setTop

public YAxis setTop(Number top)
Convenience method for setting the 'top' option of the axis. Equivalent to:

     axis.setOption("top", 300);
 
The top pixel position of the Y axis relative to the chart. Defaults to null. Note that this option is a fixed value and does not support setting the top of the axis as a percentage of the pane.

Parameters:
top - The top value of the axis.
Returns:
A reference to this YAxis instance for convenient method chaining.
Since:
1.6.0

setLabels

public YAxis setLabels(YAxisLabels labels)
Convenience method for setting the 'labels' options of the axis. Equivalent to code like:

     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)
   );
 

Parameters:
labels - The configuration object for the axis labels, or null to use the defaults.
Returns:
A reference to this YAxis instance for convenient method chaining.

setStackLabels

public YAxis setStackLabels(StackLabels stackLabels)
Convenience method for setting the 'stackLabels' options of the axis. Equivalent to code like:

     axis.setOption("/stackLabels/align", Labels.Align.LEFT);
     axis.setOption("/stackLabels/enabled", true);
     etc...
 
The stack labels show the total value for each bar in a stacked column or bar chart. The label will be placed on top of positive columns and below negative columns. In case of an inverted column chart or a bar chart the label is placed to the right of positive bars and to the left of negative bars.

Example usage:

   axis.setStackLabels(
     new StackLabels()
       .setAlign(Labels.Align.LEFT)
       .setEnabled(true)
   );
 

Parameters:
stackLabels - The configuration object for the axis stack labels, or null to use the defaults.
Returns:
A reference to this YAxis instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.