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.scatter();
3
4
// create a bubble chart
5
chart.bubble([
6
[4, 9, 10],
7
[1, 7, 6],
8
[2, 7, 15],
9
[3, 8, 20]
10
]);
11
12
// get statistical data (the maximum bubble size and the mumber of the bubbles)
13
var bubbleMaxSize = chart.getStat("dataPlotBubbleMaxSize");
14
var pointsCount = chart.getStat("dataPlotPointCount");
15
16
// set the title of the chart
17
chart.title("There Are " + pointsCount + " Bubbles, The Maximum Bubble Size Is " + bubbleMaxSize);
18
19
// set the container id for the chart
20
chart.container("container");
21
22
// initiate drawing the chart
23
chart.draw();
24
});