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.line([
3
{x: 0, 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('linear');
10
chart.annotations([{
11
type: 'ellipse',
12
xAnchor: 1.9,
13
valueAnchor: 30,
14
secondXAnchor: 2.1,
15
secondValueAnchor: 100,
16
fill: '#673AB7 0.5',
17
stroke: '3 #FF9800'
18
}]);
19
20
var annotation = chart.annotations().getAnnotationAt(0);
21
22
// Get Y-scale.
23
annotation.yScale(anychart.scales.log());
24
25
chart.title('Set Y-scale');
26
chart.container('container');
27
chart.draw();
28
});