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


public interface LegendLabelsFormatter

An interface that can be used to control the display of the labels displayed within a legend. General usage is as follows:

 chart.setLegend(
   new Legend()
     .setLegendLabelsFormatter(
         new LegendLabelsFormatter() {
            public String format(LegendLabelsData legendLabelsData) {
                return legendLabelsData.getSeriesName() + " (click to hide)";
            }
         }
     )
 );
 
See the documentation on the format(LegendLabelsData) function for more details on the capabilities available within custom formatters.

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

Method Summary
 String format(LegendLabelsData legendLabelsData)
          Callback function to format the text of a label in the legend.
 

Method Detail

format

String format(LegendLabelsData legendLabelsData)
Callback function to format the text of a label in the legend.

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.

Access to information about the series that the label applies to is provided in the given "LegendLabelsData" object, or in the case of pie chart access to information about the point.

Parameters:
legendLabelsData - 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.