org.moxieapps.gwt.highcharts.client.labels
Interface StackLabelsFormatter


public interface StackLabelsFormatter

An interface that can be used to control the display of the Y axis stack labels to contain custom text or formatting. General usage is as follows:

 chart.getYAxis().setStackLabels(
   new StackLabels()
     .setEnabled(true)
     .setFormatter(new StackLabelsFormatter() {
        public String format(StackLabelsData stackLabelsData) {
            return stackLabelsData.getTotalAsLong() + " degrees";
        }
     })
 );
 
See the documentation on the format(StackLabelsData) function for more details on the capabilities available within custom formatters.

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

Method Summary
 String format(StackLabelsData stackLabelsData)
          Callback function to format the text of a stack label on a Y axis.
 

Method Detail

format

String format(StackLabelsData stackLabelsData)
Callback function to format the text of a stack label on a Y axis.

A subset of HTML is supported. The HTML of the label is parsed and converted to SVG, therefore this isn't a complete HTML renderer. The following tags are supported: <b>, <strong>, <i>, <em>, <br/>, and <span>. Spans can be styled with a style attribute, but only text-related CSS that is shared with SVG is handled.

Available data provided in the given "StackLabelsData" object are:

Parameters:
stackLabelsData - An object containing all of the data available to the formatter that it can use to determine which text and styling to use for the label.
Returns:
The text to display for the label (including any styling).


Copyright © 2015. All Rights Reserved.