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
chart.line([
4
{x: 1, value: 0},
5
{x: 2, value: 20},
6
{x: 3, value: 10},
7
{x: 4, value: 30},
8
{x: 5, value: 20},
9
{x: 6, value: 40},
10
{x: 7, value: 30},
11
{x: 8, value: 50},
12
{x: 9, value: 40},
13
{x: 1, value: 0}
14
]);
15
16
// Get label.
17
var label = chart.label();
18
19
label.text('Custom label');
20
label.fontWeight(600);
21
label.background({fill: '#9aff9a', corners: 3});
22
label.padding(10);
23
24
chart.title('Get and modify label object');
25
chart.xGrid(true).yGrid(true);
26
chart.padding('5%');
27
chart.container('container');
28
chart.draw();
29
});