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