<div id="container"></div>
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
anychart.onDocumentReady(function () {
var chart = anychart.scatter([
{x: 3, value: 6},
{x: 1, value: 10},
{x: 2, value: 18},
{x: 3, value: 11},
{x: 3.1, value: 10},
{x: 3.1, value: 12},
{x: 4, value: 9},
{x: 2, value: 5},
{x: 4.5, value: 7},
{x: 2.1, value: 8}
]);
// Set annotations settings.
chart.annotations([{
type: 'rectangle',
xAnchor: 2.9,
valueAnchor: 13,
secondXAnchor: 3.2,
secondValueAnchor: 9,
fill: '#4CAF50 0.5',
stroke: '2 #FF9800'
}, {
type: 'ellipse',
xAnchor: 3.8,
valueAnchor: 10.5,
secondXAnchor: 4.7,
secondValueAnchor: 6,
fill: '#80deea 0.5',
stroke: '2 #FFD54F'
}]);
chart.title('Set annotations settings');
chart.container('container');
chart.draw();
});