|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.moxieapps.gwt.highcharts.client.Configurable<PlotBand> org.moxieapps.gwt.highcharts.client.PlotBand
public class 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),
);
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 |
---|
public PlotBand setColor(String color)
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.
color
- The value to set as the 'color' option on the plot band.
PlotBand
instance for convenient method chaining.public PlotBand setColor(Color color)
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.
color
- The color gradient or color with an alpha channel to set as the 'color' option on the plot band.
PlotBand
instance for convenient method chaining.public PlotBand setFrom(Number from)
plotBand.setOption("from", 40);
The start position of the plot band in axis units. Defaults to null.
from
- The start position of the plot band in axis units.
PlotBand
instance for convenient method chaining.public PlotBand setLabel(PlotBandLabel plotBandLabel)
plotBand.setOption("/label/align", PlotBandLabel.Align.LEFT);
plotBand.setOption("/label/x", 20);
etc....
plotBandLabel
- The options for the label on the plot band.
PlotBand
instance for convenient method chaining.public PlotBand setTo(Number to)
plotBand.setOption("to", 40);
The end position of the plot band in axis units. Defaults to null.
to
- The end position of the plot band in axis units.
PlotBand
instance for convenient method chaining.public PlotBand setZIndex(Number zIndex)
plotBand.setOption("zIndex", 100);
The z index of the plot band within the chart. Defaults to null.
zIndex
- The z index of the plot band within the chart.
PlotBand
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |