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: 'A1', value: 1.1},
4
{x: 'A2', value: 1.4},
5
{x: 'A3', value: 1.2},
6
{x: 'A4', value: 1.95},
7
]);
8
chart.title('Trying to get a tick');
9
chart.container('container');
10
chart.draw();
11
12
var scale = chart.yScale();
13
14
// Trying to get a tick.
15
var position = scale.inverseTransform(0.39);
16
17
// Draw a red marker on the found tick.
18
chart.lineMarker({value: position});
19
});