org.moxieapps.gwt.highcharts.client.labels
Class StackLabels

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<T>
      extended by org.moxieapps.gwt.highcharts.client.labels.Labels<StackLabels>
          extended by org.moxieapps.gwt.highcharts.client.labels.StackLabels

public class StackLabels
extends Labels<StackLabels>

Represents the configuration options that can be set for the stack labels on the y-axis of a chart, and can then be passed to the YAxis.setStackLabels(StackLabels) method. Example usage:

   chart.getYAxis().setStackLabels(
     new StackLabels()
       .setAlign(Labels.Align.LEFT)
       .setColor("#CC0000")
   );
 

Since:
1.0.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Nested Class Summary
static class StackLabels.VerticalAlign
          An enumeration of supported stack labels vertical alignment types, which can be passed to methods like setVerticalAlign(StackLabels.VerticalAlign) method.
 
Nested classes/interfaces inherited from class org.moxieapps.gwt.highcharts.client.labels.Labels
Labels.Align
 
Constructor Summary
StackLabels()
           
 
Method Summary
 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.
 
Methods inherited from class org.moxieapps.gwt.highcharts.client.labels.Labels
setAlign, setColor, setEnabled, setRotation, setStyle, setVerticalAlign, setX, setY
 
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

StackLabels

public StackLabels()
Method Detail

setFormatter

public 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. See the StackLabelsFormatter interface, and in particular the StackLabelsFormatter.format(StackLabelsData) method for more details on the capabilities available to custom formatters.

Parameters:
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).
Returns:
A reference to this StackLabels instance for convenient method chaining.

getFormatter

public 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.

Returns:
The custom axis labels formatter that has been applied to the y-axis, or null if it has not been set.

setTextAlign

public StackLabels setTextAlign(Labels.Align textAlign)
Convenience method for setting the 'textAlign' option for the labels. Equivalent to:

     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.

Parameters:
textAlign - The text alignment for the label.
Returns:
A reference to this StackLabels instance for convenient method chaining.

setVerticalAlign

public StackLabels setVerticalAlign(StackLabels.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option for the labels. Equivalent to:

     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.

Parameters:
verticalAlign - The vertical alignment of the stack total label.
Returns:
A reference to this StackLabels instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.