<div id="container"></div>
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
anychart.onDocumentReady(function () {
var chart = anychart.line();
var firstSeries = chart.line([
{x: 0, value: 22},
{x: 1, value: 34},
{x: 2, value: 16},
{x: 3, value: 12},
{x: 4, value: 41},
{x: 5, value: 47}
]);
chart.line([
{x: 0, value: 39},
{x: 1, value: 28},
{x: 2, value: 21},
{x: 3, value: 18},
{x: 4, value: 24},
{x: 5, value: 29}
chart.legend(true);
var legendItem = firstSeries.legendItem();
// Set text formatter.
legendItem.format(function () {
return '[formatted]';
});
chart.title("Set text formatter");
chart.container("container");
chart.draw();