public class StackLabels extends Labels<StackLabels>
YAxis.setStackLabels(StackLabels)
method. Example usage:
chart.getYAxis().setStackLabels(
new StackLabels()
.setAlign(Labels.Align.LEFT)
.setColor("#CC0000")
);
| Modifier and Type | Class and Description |
|---|---|
static class |
StackLabels.VerticalAlign
An enumeration of supported stack labels vertical alignment types, which can be passed to methods
like
setVerticalAlign(StackLabels.VerticalAlign) method. |
Labels.Align| Constructor and Description |
|---|
StackLabels() |
| Modifier and Type | Method and Description |
|---|---|
StackLabelsFormatter |
getFormatter()
Returns the custom stack labels formatter that has been applied to the y-axis, or null if the
built-in generic formatter is being used instead.
|
StackLabels |
setFormatter(StackLabelsFormatter stackLabelsFormatter)
Sets a custom formatter for the stack labels on the axis that can be used to control how the text of the
stack labels will be displayed.
|
StackLabels |
setTextAlign(Labels.Align textAlign)
Convenience method for setting the 'textAlign' option for the labels.
|
StackLabels |
setVerticalAlign(StackLabels.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option for the labels.
|
setAlign, setColor, setEnabled, setRotation, setStyle, setVerticalAlign, setX, setYgetOptions, setOptionpublic StackLabels setFormatter(StackLabelsFormatter stackLabelsFormatter)
StackLabelsFormatter interface, and
in particular the StackLabelsFormatter.format(StackLabelsData) method for more details on
the capabilities available to custom formatters.stackLabelsFormatter - The custom formatter to use for the stack labels (if not given a built-in
generic formatter is used which simply returns the total value of the stack).StackLabels instance for convenient method chaining.public StackLabelsFormatter getFormatter()
public StackLabels setTextAlign(Labels.Align textAlign)
stackLabels.setOption("textAlign", Labels.Align.CENTER);
The text alignment for the label. While Labels.setAlign(Align) determines where the text's
anchor point is placed with regards to the stack, 'textAlign' determines how the text is aligned
against its anchor point. Possible values are "left", "center" and "right". The default value is
calculated at runtime and depends on orientation and whether the stack is positive or negative.textAlign - The text alignment for the label.StackLabels instance for convenient method chaining.public StackLabels setVerticalAlign(StackLabels.VerticalAlign verticalAlign)
stackLabels.setOption("verticalAlign", StackLabels.VerticalAlign.MIDDLE);
Defines the vertical alignment of the stack total label. Can be one of "top", "middle" or
"bottom". The default value is calculated at runtime and depends on orientation and whether
the stack is positive or negative.verticalAlign - The vertical alignment of the stack total label.StackLabels instance for convenient method chaining.Copyright © 2015. All Rights Reserved.