HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
var chart;
2
anychart.onDocumentReady(function () {
3
anychart.data.loadJsonFile(
4
// The data used in this sample can be obtained from the CDN
5
'https://cdn.anychart.com/samples-data/graph/radial-graph/data.json',
6
function (data) {
7
// create graph chart
8
chart = anychart.graph(data);
9
10
// set chart layout settings
11
chart.layout({ iterationCount: 0 });
12
13
// set node labels settings
14
chart
15
.nodes()
16
.labels()
17
.fontSize(12)
18
.enabled(true)
19
.anchor('auto')
20
.autoRotate(true);
21
22
// set container id for the chart
23
chart.container('container');
24
// initiate chart drawing
25
chart.draw();
26
27
// set default zoom
28
chart.zoom(
29
0.68,
30
chart.getPixelBounds().width / 2,
31
chart.getPixelBounds().height / 2
32
);
33
}
34
);
35
});