org.moxieapps.gwt.highcharts.client
Interface ToolTipFormatter


public interface ToolTipFormatter

An interface that can be used to control the information of the tooltip area to contain custom text or formatting. General usage is as follows:

 chart.setToolTip(
   new ToolTip()
     .setToolTipFormatter(new ToolTipFormatter() {
        public String format(ToolTipData toolTipData) {
            return toolTipData.getXAsLong() + " degrees";
        }
     })
 );
 
See the documentation on the format(ToolTipData) 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(ToolTipData toolTipData)
          Callback function to format the text of the tooltip.
 

Method Detail

format

String format(ToolTipData toolTipData)
Callback function to format the text of the tooltip. Return null to disable tooltip for a specific point on series.

A subset of HTML is supported. The HTML of the tooltip 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.

Since version 2.1 the tooltip can be shared between multiple series through the ToolTip.setShared(boolean) option. The available data in the formatter differ a bit depending on whether the tooltip is shared or not. In a shared tooltip, all properties except x, which is common for all points, are kept in an array, this.points.

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

Parameters:
toolTipData - An object containing all of the data available to the formatter that it can use to determine which text and styling to use in the tooltip.
Returns:
The text to include in the tooltip (including any styling), or null to disable the tooltip for the data point.


Copyright © 2015. All Rights Reserved.