anychart.onDocumentReady(function () {
var data = anychart.data.set([
["January", 12000, 10000, 7000, 11000],
["February", 15000, 12000, 9000, 13000],
["March", 16000, 15000, 14000, 12000],
["April", 15000, 11000, 13000, 10000],
["May", 10000, 9000, 11000, 6000]
var seriesData1 = data.mapAs({x: 0, value: 1});
var seriesData2 = data.mapAs({x: 0, value: 2});
var seriesData3 = data.mapAs({x: 0, value: 3});
var seriesData4 = data.mapAs({x: 0, value: 4});
var chart = anychart.line();
var series1 = chart.line(seriesData1);
var series2 = chart.line(seriesData2);
var series3 = chart.line(seriesData3);
var series4 = chart.line(seriesData4);
chart.legend().useHtml(true);
chart.legend().itemsFormat(function() {
return "<span style='color:" + this.series.color() +
";font-weight:600'>" + this.series.name() +
"</span>: $" + this.series.getStat("sum");
chart.title("Legend Items: Text Format (Formatting Functions)" +
chart.container("container");