org.moxieapps.gwt.highcharts.client
Class PlotBand

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

public class PlotBand
extends Configurable<PlotBand>

A configurable class that can be used to represent plot bands across an area of the chart, which can then be set on an axis (via the Axis.setPlotBands(PlotBand...) method.) Note that a plot band is a colored band stretching across the plot area marking an interval on the axis. Example usage:

   XAxis xAxis = chart.getXAxis();
   xAxis.setPlotBands(
     xAxis.createPlotBand()
        .setColor("#CC0000")
        .setFrom(40)
        .setTo(80),
     xAxis.createPlotBand()
        .setColor("#00CC00")
        .setFrom(80)
        .setTo(120),
   );
 

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

Method Summary
 PlotBand setColor(Color color)
          Convenience method for setting the 'color' option of the plot band, allowing for colors with opacity or gradients.
 PlotBand setColor(String color)
          Convenience method for setting the 'color' option of the plot band to an RGB hex value.
 PlotBand setFrom(Number from)
          Convenience method for setting the 'from' option of the plot band.
 PlotBand setLabel(PlotBandLabel plotBandLabel)
          Convenience method for setting the 'label' options of the plot band.
 PlotBand setTo(Number to)
          Convenience method for setting the 'to' option of the plot band.
 PlotBand setZIndex(Number zIndex)
          Convenience method for setting the 'zIndex' option of the plot band.
 
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

setColor

public PlotBand setColor(String color)
Convenience method for setting the 'color' option of the plot band to an RGB hex value. Equivalent to:

     plotBand.setOption("color", "#CCCCCC");
 
The RGB color for the plot band. Defaults to null.

Note that this method is intended for setting the color to a simple RBG hex value. If you instead want to set a color to include an alpha channel or a gradient, use the setColor(Color) version instead.

Parameters:
color - The value to set as the 'color' option on the plot band.
Returns:
A reference to this PlotBand instance for convenient method chaining.

setColor

public PlotBand setColor(Color color)
Convenience method for setting the 'color' option of the plot band, allowing for colors with opacity or gradients. Equivalent to:

     plotBand.setOption("color", new Color()
        .setLinearGradient(0.0, 0.0, 1.0, 1.0)
        .addStop(new Color(255, 255, 255))
        .addStop(new Color(200, 200, 255))
     );
 
The color or gradient for the plot band. Defaults to null.

Note that this method is intended for setting the color to a gradient or color that includes an alpha channel. If you instead just want to set the color to a normal RGB hex value you can use the setColor(String) version instead.

Parameters:
color - The color gradient or color with an alpha channel to set as the 'color' option on the plot band.
Returns:
A reference to this PlotBand instance for convenient method chaining.

setFrom

public PlotBand setFrom(Number from)
Convenience method for setting the 'from' option of the plot band. Equivalent to:

     plotBand.setOption("from", 40);
 
The start position of the plot band in axis units. Defaults to null.

Parameters:
from - The start position of the plot band in axis units.
Returns:
A reference to this PlotBand instance for convenient method chaining.

setLabel

public PlotBand setLabel(PlotBandLabel plotBandLabel)
Convenience method for setting the 'label' options of the plot band. Equivalent to:

     plotBand.setOption("/label/align", PlotBandLabel.Align.LEFT);
     plotBand.setOption("/label/x", 20);
     etc....
 

Parameters:
plotBandLabel - The options for the label on the plot band.
Returns:
A reference to this PlotBand instance for convenient method chaining.

setTo

public PlotBand setTo(Number to)
Convenience method for setting the 'to' option of the plot band. Equivalent to:

     plotBand.setOption("to", 40);
 
The end position of the plot band in axis units. Defaults to null.

Parameters:
to - The end position of the plot band in axis units.
Returns:
A reference to this PlotBand instance for convenient method chaining.

setZIndex

public PlotBand setZIndex(Number zIndex)
Convenience method for setting the 'zIndex' option of the plot band. Equivalent to:

     plotBand.setOption("zIndex", 100);
 
The z index of the plot band within the chart. Defaults to null.

Parameters:
zIndex - The z index of the plot band within the chart.
Returns:
A reference to this PlotBand instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.