|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.moxieapps.gwt.highcharts.client.Configurable<PlotLine>
org.moxieapps.gwt.highcharts.client.PlotLine
public class PlotLine
A configurable class that can be used to represent plot lines on an axis of the chart, which can
then be set on an axis (via the Axis.setPlotLines(PlotLine...)
method.)
Note that a plot line is a line stretching across the plot area, marking a specific value on one of the axes.
Example usage:
XAxis xAxis = chart.getXAxis();
xAxis.setPlotLines(
xAxis.createPlotLine()
.setColor("#CC0000")
.setValue(40),
xAxis.createPlotLine()
.setColor("#009900")
.setValue(60)
);
Nested Class Summary | |
---|---|
static class |
PlotLine.DashStyle
An enumeration of supported dash style types, which can be passed to the setDashStyle(DashStyle) method. |
Method Summary | |
---|---|
PlotLine |
setColor(Color color)
Convenience method for setting the 'color' option of the plot line, allowing for colors with opacity or gradients. |
PlotLine |
setColor(String color)
Convenience method for setting the 'color' option of the plot line to an RGB hex value. |
PlotLine |
setDashStyle(PlotLine.DashStyle dashStyle)
Convenience method for setting the 'dashStyle' plot line optoin. |
PlotLine |
setLabel(PlotLineLabel plotLineLabel)
Convenience method for setting the 'label' options of the plot line. |
PlotLine |
setValue(Number value)
Convenience method for setting the 'value' option of the plot line. |
PlotLine |
setWidth(Number width)
Convenience method for setting the 'width' option of the plot line. |
PlotLine |
setZIndex(Number zIndex)
Convenience method for setting the 'zIndex' option of the plot line. |
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 PlotLine setColor(String color)
plotLine.setOption("color", "#CCCCCC");
The RGB color for the plot line. 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 line.
PlotLine
instance for convenient method chaining.public PlotLine setColor(Color color)
plotLine.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 line. 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 line.
PlotLine
instance for convenient method chaining.public PlotLine setDashStyle(PlotLine.DashStyle dashStyle)
plotLine.setOption("dashStyle", DashStyle.DOT);
The dashing or dot style for the plot line. Defaults to PlotLine.DashStyle.SOLID
. See this
demonstration for a visible reference
of the available dash styles.
dashStyle
- The dash style to use for this plot line, or null to use the default.
PlotLine
instance for convenient method chaining.public PlotLine setLabel(PlotLineLabel plotLineLabel)
plotLine.setOption("/label/align", PlotLineLabel.Align.LEFT);
plotLine.setOption("/label/x", 20);
etc....
plotLineLabel
- The options for the label on the plot line.
PlotLine
instance for convenient method chaining.public PlotLine setValue(Number value)
plotLine.setOption("value", 40);
The position of the line in axis units. Defaults to null.
value
- The position of the line in axis units.
PlotLine
instance for convenient method chaining.public PlotLine setWidth(Number width)
plotLine.setOption("width", 2);
The width or thickness of the plot line. Defaults to null.
width
- The width or thickness of the plot line.
PlotLine
instance for convenient method chaining.public PlotLine setZIndex(Number zIndex)
plotLine.setOption("zIndex", 100);
The z index of the plot line within the chart. Defaults to null.
zIndex
- The z index of the plot line within the chart.
PlotLine
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |