org.moxieapps.gwt.highcharts.client
Class AxisTitle

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<AxisTitle>
      extended by org.moxieapps.gwt.highcharts.client.AxisTitle

public class AxisTitle
extends Configurable<AxisTitle>

A configurable class that can be used to represent custom title options for an axis, which can then be set on a specific axis (via the Axis.setAxisTitle(AxisTitle) method.) Example usage:

   chart.getXAxis().setAxisTitle(
     new AxisTitle()
       .setText("Sales by Month")
       .setAlign(AxisTitle.Align.MIDDLE)
   );
 

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

Nested Class Summary
static class AxisTitle.Align
          An enumeration of supported axis title alignment types, which can be passed to methods like setAlign(AxisTitle.Align) method.
 
Constructor Summary
AxisTitle()
           
 
Method Summary
 AxisTitle setAlign(AxisTitle.Align align)
          Convenience method for setting the 'align' option of the title.
 AxisTitle setMargin(Number margin)
          Convenience method for setting the 'margin' option of the title.
 AxisTitle setRotation(Number rotation)
          Convenience method for setting the 'margin' option of the title.
 AxisTitle setStyle(Style style)
          Convenience method for setting the 'style' options of the axis title.
 AxisTitle setText(String text)
          Convenience method for setting the 'text' option of the title.
 AxisTitle setY(Number y)
          Convenience method for setting the 'y' option of the title.
 
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
 

Constructor Detail

AxisTitle

public AxisTitle()
Method Detail

setAlign

public AxisTitle setAlign(AxisTitle.Align align)
Convenience method for setting the 'align' option of the title. Equivalent to:

     axisTitle.setOption("align", AxisTitle.Align.LOW);
 
Alignment of the title relative to the axis values. Possible values are "low", "middle" or "high". Defaults to AxisTitle.Align.MIDDLE.

Parameters:
align - The alignment of the title relative to the axis values.
Returns:
A reference to this AxisTitle instance for convenient method chaining.

setMargin

public AxisTitle setMargin(Number margin)
Convenience method for setting the 'margin' option of the title. Equivalent to:

     axisTitle.setOption("margin", 60);
 
The pixel distance between the axis labels or line and the title. Defaults to 0 for horizontal axis, 10 for vertical axis.

Parameters:
margin - The pixel distance between the axis labels or line and the title.
Returns:
A reference to this AxisTitle instance for convenient method chaining.

setRotation

public AxisTitle setRotation(Number rotation)
Convenience method for setting the 'margin' option of the title. Equivalent to:

     axisTitle.setOption("margin", 60);
 
The rotation of the text in degrees. 0 is horizontal, 270 is vertical reading from bottom to top. Defaults to 0.

Parameters:
rotation - The rotation of the text in degrees.
Returns:
A reference to this AxisTitle instance for convenient method chaining.

setStyle

public AxisTitle setStyle(Style style)
Convenience method for setting the 'style' options of the axis title. Equivalent to:

     axisTitle.setOption("/style/fontWeight", "bold");
     axisTitle.setOption("/style/fontFamily", "serif");
     etc.
 
CSS styles for the title. When titles are rotated they are rendered using vector graphic techniques and not all styles are applicable. Most noteworthy, a bug in IE8 renders all rotated strings bold and italic. Defaults to:

Parameters:
style - CSS styles for the axis title.
Returns:
A reference to this AxisTitle instance for convenient method chaining.

setText

public AxisTitle setText(String text)
Convenience method for setting the 'text' option of the title. Equivalent to:

     axisTitle.setOption("text", "Sales by Month");
 
The actual text of the axis title. It can contain basic HTML text markup like <b>, <i> and spans with style. Defaults to null.

Note to disable an axis title from being displayed completely, simply set the text to "null". (This can also be accomplished more simply by just setting the title text to null directly on the axis via the Axis.setAxisTitleText(String) method.)

Parameters:
text - The actual text of the axis title.
Returns:
A reference to this AxisTitle instance for convenient method chaining.

setY

public AxisTitle setY(Number y)
Convenience method for setting the 'y' option of the title. Equivalent to:

     axisTitle.setOption("y", 25);
 

Parameters:
y - The number of pixels that the y-axis will be offset
Returns:
A reference to this AxisTitle instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.