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: 5},
4
{x: 1, value: 9},
5
{x: 2, value: 2},
6
{x: 3, value: 6}
7
]);
8
9
var rangeMarker = chart.rangeMarker();
10
rangeMarker.from(5.5);
11
rangeMarker.to(6.5);
12
rangeMarker.fill('#458b00', 0.3);
13
14
// Set event type.
15
rangeMarker.listen('axisMarkerMove', function (e) {
16
chart.title('The mouse is moved over of the marker with a range ' + e.formattedValue)
17
});
18
19
chart.title('AxisMarkerMove event');
20
chart.container('container');
21
chart.draw();
22
});