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
4
var series1 = chart.line([
5
{x: 'Cycling', value: 10},
6
{x: 'Swimming', value: 32},
7
{x: 'Run', value: 18}
8
]);
9
series1.markers(true);
10
11
var series2 = chart.line([
12
{x: 'Cycling', value: 15},
13
{x: 'Swimming', value: 9},
14
{x: 'Run', value: 29}
15
]);
16
17
chart.legend(true);
18
19
var item = series1.legendItem();
20
item.iconType('line');
21
22
// Set stroke.
23
item.iconMarkerStroke('#000000', 1, '4 2');
24
25
chart.title('Set stroke parameters');
26
chart.container('container');
27
chart.draw();
28
});