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.bubble();
3
chart.yScale().minimum(0);
4
chart.yScale().maximum(4);
5
6
var series = chart.bubble([
7
[1, 1, 6],
8
[2, 2, 4],
9
[3, 3, 6],
10
[4, 2, 2],
11
[5, 1, 7],
12
[6, 2, 3],
13
[7, 1, 2]
14
]);
15
16
var seriesTooltip = series.tooltip();
17
18
seriesTooltip.format(function () {
19
var bubbleSeries = this.series;
20
var index = this.index;
21
var point = bubbleSeries.getPoint(index);
22
23
// Get statistics.
24
return "Bubble size: " + point.getStat("bubbleSize");
25
});
26
27
chart.title("Get the statistic and use the tooltip.");
28
chart.container("container");
29
chart.draw();
30
});