org.moxieapps.gwt.highcharts.client.labels
Interface AxisLabelsFormatter
public interface AxisLabelsFormatter
An interface that can be used to control the display of the X or Y axis labels to contain
custom text or formatting. General usage is as follows:
chart.getXAxis().setLabels(
new XAxisLabels()
.setFormatter(new AxisLabelsFormatter() {
public String format(AxisLabelsData axisLabelsData) {
return axisLabelsData.getValueAsLong() + " degrees";
}
})
);
See the documentation on the format(AxisLabelsData)
function for more details on the
capabilities available within custom formatters.
- Since:
- 1.0.0
- Author:
- squinn@moxiegroup.com (Shawn Quinn)
format
String format(AxisLabelsData axisLabelsData)
- Callback function to format the text of a label on an 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 "AxisLabelsData" object are:
-
value : The numeric or categorical string value to display.
- Parameters:
axisLabelsData
- 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.