LegendFormatter: Function;
The LegendFormatter property determines formatting applied to chart legend items.
The property value is set in the Chart constructor or using the setLegendFormatter method and is returned using the getLegendFormatter method.
To execute the example, the HTML page must contain the Chart component named chart (see Example of Creating a Histogram). Set formatting for chart legend labels:
// Set formatting of chart legend labels chart.setLegendFormatter(function(item) { return '[' + item.name + ']'; }); // Redraw the chart chart.redraw(true);
After executing the example square brackets are added to labels of the chart legend:
See also: