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: 0.6, value: 22},
4
{x: 1.7, value: 55},
5
{x: 2.3, value: 50},
6
{x: 3.5, value: 80},
7
{x: 3.9, value: 74},
8
{x: 4, value: 68},
9
{x: 4, value: 76},
10
{x: 4.1, value: 84},
11
{x: 4.7, value: 93}
12
]);
13
14
var series = chart.getSeries(0);
15
series.selected({fill: '#4CAF50'});
16
series.select([1, 3]);
17
18
chart.listen('chartDraw', function () {
19
20
// Get selected points.
21
var points = chart.getSelectedPoints();
22
23
var point = points[0];
24
return point.selected(false);
25
});
26
27
chart.title('Get an array of the selected points and modify the point');
28
chart.container('container');
29
chart.draw();
30
});