HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
var chart = anychart.line([8, 7, 3, 2], [6, 1, 2, 5]);
3
chart.legend(true);
4
5
var legend = chart.legend();
6
7
// Set mode.
8
legend.itemsSourceMode('categories');
9
10
chart.title('Set items source mode');
11
chart.container('container');
12
chart.draw();
13
});