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
{x: 2, value: 6},
4
{x: 1, value: 10},
5
{x: 2, value: 18},
6
{x: 3, value: 11},
7
{x: 4, value: 9}
8
]);
9
chart.xScale().minimum(-1);
10
11
// Get annotation settings.
12
var annotation = chart.annotations();
13
14
chart.title('Get and modify annotation object. Use mouse to draw annotation');
15
chart.container('container');
16
chart.draw();
17
18
annotation.startDrawing('rectangle');
19
});