public abstract class Labels<T extends Labels> extends Configurable<T>
Configurable.setOption(String, Object)
method. But also exposes type specific methods that the caller is encouraged to use instead,
such as setAlign(org.moxieapps.gwt.highcharts.client.labels.Labels.Align), setColor(String), etc.
Note that this class is abstract and therefore can't be instantiated directly. Instead you
should create an instance of more specific sub type, such as XAxisLabels, YAxisLabels,
or DataLabels.| Modifier and Type | Class and Description |
|---|---|
static class |
Labels.Align
An enumeration of supported label alignment types, which can be passed to methods
like
setAlign(org.moxieapps.gwt.highcharts.client.labels.Labels.Align) method. |
static class |
Labels.VerticalAlign |
| Constructor and Description |
|---|
Labels() |
| Modifier and Type | Method and Description |
|---|---|
T |
setAlign(Labels.Align align)
Convenience method for setting the 'align' option for the labels.
|
T |
setColor(String color)
Convenience method for setting the 'color' option for the data labels.
|
T |
setEnabled(boolean enabled)
Convenience method for setting the 'enabled' option for the data labels.
|
T |
setRotation(Number rotation)
Convenience method for setting the 'rotation' option for the labels.
|
T |
setStyle(Style style)
Convenience method for setting the 'style' options of the labels.
|
T |
setVerticalAlign(Labels.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option for the labels.
|
T |
setX(Number x)
Convenience method for setting the 'x' position option of the label.
|
T |
setY(Number y)
Convenience method for setting the 'y' position option of the label.
|
getOptions, setOptionpublic T setAlign(Labels.Align align)
labels.setOption("align", Labels.Align.CENTER);
The alignment of the data label compared to the point. Can be one of "left", "center" or "right". Defaults to "center".align - The alignment of the label compared to the point.Labels instance for convenient method chaining.public T setColor(String color)
labels.setOption("color", "#CC0000");
The text color for the data labels. Defaults to null.color - The text color to use for the labels.Labels instance for convenient method chaining.public T setEnabled(boolean enabled)
labels.setOption("enabled", true);
Enable or disable the data labels. Defaults to false.enabled - Whether or not to enable or disable the data labels.Labels instance for convenient method chaining.public T setRotation(Number rotation)
labels.setOption("rotation", 90.0f);
Text rotation in degrees. Defaults to 0.rotation - Text rotation in degrees.Labels instance for convenient method chaining.public T setStyle(Style style)
labels.setOption("/style/fontWeight", "bold");
labels.setOption("/style/fontFamily", "serif");
etc.
CSS styles for the labels. Defaults to:
style - CSS styles for the labels.Labels instance for convenient method chaining.public T setVerticalAlign(Labels.VerticalAlign verticalAlign)
labels.setOption("verticalAlign", Labels.VerticalAlign.TOP);
The vertical alignment of the data label compared to the point. Can be one of "top", "middle" or "bottom". Defaults to "center".verticalAlign - The vertical alignment of the label compared to the point.Labels instance for convenient method chaining.public T setX(Number x)
labels.setOption("x", 70);
The x position offset of the label relative to the point. Defaults to 0 for series data labels,
-8 y-axis labels, and 0 x-axis labels.x - The x position of the title, relative to the chart's spacing.Labels instance for convenient method chaining.public T setY(Number y)
labels.setOption("y", -20);
The y position offset of the label relative to the point. Defaults to -6 for series data labels,
3 for y-axis labels, and 0 for x-axis labels.y - The y position of the title, relative to the chart's spacing.Labels instance for convenient method chaining.Copyright © 2015. All Rights Reserved.