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();
3
chart.legend(true);
4
5
var firstSeries = chart.line([35, 15, 20, 19, 40, 10, 23]);
6
firstSeries.legendItem({text: "Light blue line", iconType: "circle", iconFill: "#81D4FA"});
7
8
var secondSeries = chart.line([4, 6, 4, 9, 20, 30, 43]);
9
secondSeries.legendItem({text: "Blue line", iconType: "square", iconFill: "#90CAF9"});
10
11
chart.container("container");
12
chart.draw();
13
14
// Gets legend item.
15
var legendItem = firstSeries.legendItem();
16
legendItem.disabled(true);
17
});