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.scatter();
3
4
var series = chart.marker([
5
{x: 20, value: 0},
6
{x: 20, value: 20},
7
{x: 20, value: 40},
8
{x: 20, value: 60},
9
{x: 20, value: 80},
10
{x: 20, value: 100}
11
]);
12
series.id('green').size(15);
13
14
chart.line([
15
{x: 20, value: 100},
16
{x: 30, value: 60},
17
{x: 24, value: 60},
18
{x: 35, value: 20},
19
{x: 20, value: 20}
20
]);
21
22
chart.line([
23
{x: 20, value: 100},
24
{x: 10, value: 60},
25
{x: 16, value: 60},
26
{x: 5, value: 20},
27
{x: 20, value: 20}
28
]);
29
30
// Get series by id.
31
var seriesById = chart.getSeries('green');
32
33
seriesById.fill('#4CAF50');
34
seriesById.stroke('#4CAF50');
35
36
chart.title('Get and modify series by id');
37
chart.yScale().minimum(-4);
38
chart.container('container');
39
chart.draw();
40
});