|
||||||||||
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<PlotBandLabel> org.moxieapps.gwt.highcharts.client.labels.PlotBandLabel
public class PlotBandLabel
Represents the configuration options that can be set for the labels of a PlotBand
, and
can then be passed to the PlotBand.setLabel(PlotBandLabel)
method. Example usage:
XAxis xAxis = chart.getXAxis();
xAxis.setPlotBands(
xAxis.createPlotBand()
.setColor("#CC0000")
.setFrom(40)
.setTo(80)
.setPlotBandLabel(
new PlotBandLabel()
.setAlign(PlotBandLabel.LEFT)
.setX(20)
),
xAxis.createPlotBand()
.setColor("#009900")
.setFrom(80)
.setTo(120)
);
Nested Class Summary | |
---|---|
static class |
PlotBandLabel.Align
An enumeration of supported plot band label alignment types, which can be passed to methods like setAlign(Align) method. |
static class |
PlotBandLabel.TextAlign
An enumeration of supported plot band label text alignment types, which can be passed to methods like setTextAlign(TextAlign) method. |
static class |
PlotBandLabel.VerticalAlign
An enumeration of supported plot band label vertical alignment types, which can be passed to methods like setVerticalAlign(PlotBandLabel.VerticalAlign) . |
Constructor Summary | |
---|---|
PlotBandLabel()
|
Method Summary | |
---|---|
PlotBandLabel |
setAlign(PlotBandLabel.Align align)
Convenience method for setting the 'align' option for the label. |
PlotBandLabel |
setRotation(Number rotation)
Convenience method for setting the 'rotation' option for the label. |
PlotBandLabel |
setStyle(Style style)
Convenience method for setting the 'style' options of the labels. |
PlotBandLabel |
setText(String text)
Convenience method for setting the 'text' option of the label. |
PlotBandLabel |
setTextAlign(PlotBandLabel.TextAlign textAlign)
Convenience method for setting the 'textAlign' option for the label. |
PlotBandLabel |
setVerticalAlign(PlotBandLabel.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option for the label. |
PlotBandLabel |
setX(Number x)
Convenience method for setting the 'x' position option of the label. |
PlotBandLabel |
setY(Number y)
Convenience method for setting the 'y' position option of the label. |
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 |
---|
public PlotBandLabel()
Method Detail |
---|
public PlotBandLabel setAlign(PlotBandLabel.Align align)
plotBandLabel.setOption("align", PlotBandLabel.Align.CENTER);
Horizontal alignment of the label. Can be one of "left", "center" or "right". Defaults to "center".
align
- The horizontal alignment of the label.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setRotation(Number rotation)
plotBandLabel.setOption("rotation", 90.0f);
Rotation of the text label in degrees. Defaults to 0 for horizontal plot lines and 90 for vertical lines.
rotation
- Rotation of the text label in degrees.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setStyle(Style style)
plotBandLabel.setOption("/style/fontWeight", "bold");
plotBandLabel.setOption("/style/fontFamily", "serif");
etc.
style
- CSS styles for the text labels.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setText(String text)
plotBandLabel.setOption("text", "Hi Mom!");
text
- The raw text to display as the label.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setTextAlign(PlotBandLabel.TextAlign textAlign)
plotBandLabel.setOption("textAlign", PlotBandLabel.TextAlign.RIGHT);
The text alignment for the label. While align
determines where the texts anchor point
is placed within the plot band, textAlign
determines how the text is aligned against
its anchor point. Possible values are "left", "center" and "right".
Defaults to the same as the align
option.
textAlign
- The text alignment for the label.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setVerticalAlign(PlotBandLabel.VerticalAlign verticalAlign)
plotBandLabel.setOption("verticalAlign", PlotBandLabel.VerticalAlign.TOP);
Vertical alignment of the label relative to the plot band. Can be one of "top", "middle" or "bottom". Defaults to "top".
verticalAlign
- The vertical alignment of the label relative to the plot band.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setX(Number x)
plotBandLabel.setOption("x", 70);
Horizontal position relative the alignment. Default varies by orientation.
x
- The horizontal position relative the alignment.
PlotBandLabel
instance for convenient method chaining.public PlotBandLabel setY(Number y)
plotBandLabel.setOption("y", -20);
Vertical position of the text baseline relative to the alignment. Default varies by orientation.
y
- The vertical position of the text baseline relative to the alignment.
PlotBandLabel
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |