public abstract class BaseDataLabels<T extends BaseDataLabels> extends Labels<T>
DataLabels and ProportionalDataLabels to prevent code duplication
while still maintaining a cleaner way for the user to utilize the method chaining with the generics
in place. You should not use this class directly, but instead use one of the base classes.Labels.Align, Labels.VerticalAlign| Constructor and Description |
|---|
BaseDataLabels() |
| Modifier and Type | Method and Description |
|---|---|
DataLabelsFormatter |
getFormatter()
Returns the custom data labels formatter that has been applied to the labels, or null if the
built-in generic formatter is being used instead.
|
T |
setBackgroundColor(String backgroundColor)
Convenience method for setting the 'backgroundColor' option for the data labels.
|
T |
setBorderColor(String borderColor)
Convenience method for setting the 'borderColor' option for the data labels.
|
T |
setBorderRadius(Number borderRadius)
Convenience method for setting the 'borderRadius' option for the data labels.
|
T |
setBorderWidth(Number borderWidth)
Convenience method for setting the 'borderWidth' option for the data labels.
|
T |
setFormat(String format)
Convenience method for setting the 'format' option for a dataLabel.
|
T |
setFormatter(DataLabelsFormatter dataLabelsFormatter)
Sets a custom formatter for the labels that can be used to control how the text of the
data labels will be displayed.
|
T |
setPadding(Number padding)
Convenience method for setting the 'padding' option for the data labels.
|
T |
setShadow(boolean shadow)
Convenience method for setting the 'shadow' option for the data labels.
|
T |
setUseHTML(Boolean useHTML)
Convenience method for setting the 'useHTML' option for the data labels.
|
setAlign, setColor, setEnabled, setRotation, setStyle, setVerticalAlign, setX, setYgetOptions, setOptionpublic T setBackgroundColor(String backgroundColor)
labels.setOption("backgroundColor", "#CC0000");
The background color or gradient for the data label. Defaults to undefined.backgroundColor - The background color or gradient for the data label.BaseDataLabels instance for convenient method chaining.public T setBorderColor(String borderColor)
labels.setOption("borderColor", "#CC0000");
The border color for the data label. Defaults to undefined.borderColor - The border color for the data label.BaseDataLabels instance for convenient method chaining.public T setBorderRadius(Number borderRadius)
labels.setOption("borderRadius", 3);
The border radius in pixels for the data label. Defaults to 0.borderRadius - The border radius in pixels for the data label.BaseDataLabels instance for convenient method chaining.public T setBorderWidth(Number borderWidth)
labels.setOption("borderWidth", 3);
The border width in pixels for the data label. Defaults to 0.borderWidth - The border width in pixels for the data label.BaseDataLabels instance for convenient method chaining.public T setPadding(Number padding)
labels.setOption("padding", 3);
When either the borderWidth or the backgroundColor is set, this is the padding within the box. Defaults to 2.padding - The padding within the box (only visible when 'borderWidth' is non-zero).BaseDataLabels instance for convenient method chaining.public T setShadow(boolean shadow)
labels.setOption("shadow", true);
The shadow of the box. Works best with borderWidth or backgroundColor Defaults to false.shadow - 'true' to disable a shadow around the box.BaseDataLabels instance for convenient method chaining.public T setUseHTML(Boolean useHTML)
labels.setOption("useHTML", false);
Whether to use HTML to render the data label text.
Using HTML allows for advanced formatting, images and reliable bi-directional text rendering.
Note that exported images won't respect the HTML, and that HTML won't respect Z-index settings.useHTML - 'true' to use HTML to render label texts.BaseDataLabels instance for convenient method chaining.public T setFormat(String format)
dataLabel.setOption("format", "{y} mm");
A format string for the data label. Available variables are the same as for formatter. Defaults to {y}.format - A format string used to set the format for s series on a chart.BaseDataLabels instance for convenient method chaining.public T setFormatter(DataLabelsFormatter dataLabelsFormatter)
DataLabelsFormatter interface, and
in particular the DataLabelsFormatter.format(DataLabelsData) method for more details on
the capabilities available to custom formatters.dataLabelsFormatter - The custom formatter to use for the labels (if not given a built-in
generic formatter is used which simply returns the Y value of the point).DataLabels instance for convenient method chaining.public DataLabelsFormatter getFormatter()
Copyright © 2015. All Rights Reserved.