org.moxieapps.gwt.highcharts.client
Class ChartSubtitle

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

public class ChartSubtitle
extends Configurable<ChartSubtitle>

A configurable class that can be used to represent custom sub title options for the chart, which can then be set on the chart (via the BaseChart.setChartSubtitle(ChartSubtitle) method.) Example usage:

   chart.setChartSubTitle(
     new ChartSubtitle()
       .setText("Source: Wikipedia")
       .setAlign(ChartTitle.Align.MIDDLE)
   );
 

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

Constructor Summary
ChartSubtitle()
           
 
Method Summary
 ChartSubtitle setAlign(ChartTitle.Align align)
          Convenience method for setting the 'align' option of the subtitle.
 ChartSubtitle setFloating(boolean floating)
          Convenience method for setting the 'floating' option of the subtitle.
 ChartSubtitle setStyle(Style style)
          Convenience method for setting the 'style' options of the subtitle.
 ChartSubtitle setText(String text)
          Convenience method for setting the 'text' option of the subtitle.
 ChartSubtitle setVerticalAlign(ChartTitle.VerticalAlign verticalAlign)
          Convenience method for setting the 'verticalAlign' option of the subtitle.
 ChartSubtitle setX(Number x)
          Convenience method for setting the 'x' position option of the subtitle.
 ChartSubtitle setY(Number y)
          Convenience method for setting the 'y' position option of the subtitle.
 
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

ChartSubtitle

public ChartSubtitle()
Method Detail

setAlign

public ChartSubtitle setAlign(ChartTitle.Align align)
Convenience method for setting the 'align' option of the subtitle. Equivalent to:

     chartSubtitle.setOption("align", chartSubtitle.Align.LEFT);
 
The horizontal alignment of the subtitle. Can be one of "left", "center" and "right". Defaults to ChartTitle.Align.CENTER.

Parameters:
align - The horizontal alignment of the subtitle.
Returns:
A reference to this ChartSubtitle instance for convenient method chaining.

setFloating

public ChartSubtitle setFloating(boolean floating)
Convenience method for setting the 'floating' option of the subtitle. Equivalent to:

     chartSubtitle.setOption("floating", true);
 
When the subtitle is floating, the plot area will not move to make space for it. Defaults to false.

Parameters:
floating - 'true' to float the subtitle above the plot area, or 'false' (the default) to make space for it.
Returns:
A reference to this ChartSubtitle instance for convenient method chaining.

setStyle

public ChartSubtitle setStyle(Style style)
Convenience method for setting the 'style' options of the subtitle. Equivalent to:

     chartSubtitle.setOption("/style/fontWeight", "bold");
     chartSubtitle.setOption("/style/fontFamily", "serif");
     etc.
 
CSS styles for the subtitle. Exact positioning of the title can be achieved by changing the margin property, or by adding position: "absolute" and left and top properties. Defaults to:

Parameters:
style - CSS styles for the subtitle.
Returns:
A reference to this ChartSubtitle instance for convenient method chaining.

setText

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

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

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

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

setVerticalAlign

public ChartSubtitle setVerticalAlign(ChartTitle.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option of the subtitle. Equivalent to:

     chartSubtitle.setOption("verticalAlign", chartSubtitle.VerticalAlign.BOTTOM);
 
The vertical alignment of the subtitle. Can be one of "top", "middle" and "bottom". Defaults to "top". Defaults to ChartTitle.VerticalAlign.TOP.

Parameters:
verticalAlign - The vertical alignment of the subtitle.
Returns:
A reference to this ChartSubtitle instance for convenient method chaining.

setX

public ChartSubtitle setX(Number x)
Convenience method for setting the 'x' position option of the subtitle. Equivalent to:

     chartSubtitle.setOption("x", 70);
 
The x position of the subtitle relative to the alignment within the spacing set on the chart controlled via BaseChart.setSpacingLeft(Number) and BaseChart.setSpacingRight(Number). Defaults to 0.

Parameters:
x - The x position of the subtitle, relative to the chart's spacing.
Returns:
A reference to this ChartSubtitle instance for convenient method chaining.

setY

public ChartSubtitle setY(Number y)
Convenience method for setting the 'y' position option of the subtitle. Equivalent to:

     chartSubtitle.setOption("y", -20);
 
The y position of the subtitle relative to the alignment within the spacing set on the chart controlled via BaseChart.setSpacingTop(Number) and BaseChart.setSpacingBottom(Number). Defaults to 25.

Parameters:
y - The y position of the subtitle, relative to the chart's spacing.
Returns:
A reference to this ChartSubtitle instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.