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
3
// load a json data file
4
anychart.data.loadJsonFile('https://gist.githubusercontent.com/awanshrestha/ff3ae5c08238b1f4f950f022aaad2f6f/raw/3766915befaeea7a32f3d41fdc2ece110e7543d7/circle-packing-chart.json',
5
function(data) {
6
7
// add the data
8
var treeData = anychart.data.tree(data, 'as-table');
9
10
// create a circle packing chart instance
11
var chart = anychart.circlePacking(treeData);
12
13
// add a chart title
14
chart.title("100 Richest People, According to Forbes");
15
16
// specify the container element id
17
chart.container('container');
18
19
// initiate the drawing of the chart
20
chart.draw();
21
22
}
23
);
24
});