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 stage = anychart.graphics.create('container');
3
4
var rect = stage.rect(0, 0, stage.width(), stage.height());
5
rect.fill('#2BC0E4');
6
7
var chart = anychart.column([
8
{x: 'John', value: 10000},
9
{x: 'Jake', value: 12000},
10
{x: 'Peter', value: 18000},
11
{x: 'James', value: 11000},
12
{x: 'Mary', value: 9000}
13
]);
14
15
chart.margin('15%');
16
chart.background('#EAECC6');
17
18
var tooltip = chart.tooltip();
19
20
// Let tooltips to leave the screen bounds.
21
tooltip.allowLeaveScreen(true);
22
23
// Let tooltips to leave the stage bounds.
24
tooltip.allowLeaveStage(true);
25
26
// Let tooltips to leave the chart bounds.
27
tooltip.allowLeaveChart(true);
28
29
var series = chart.getSeries(0);
30
series.tooltip().format('This tooltip can be demonstrated out of the chart, stage, screen, if this becomes necessary to show it all');
31
32
chart.title('Tooltips can leave the chart, the stage and the screen bounds');
33
chart.container(stage);
34
chart.draw();
35
});