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.onDocumentLoad(function () {
2
var data = {
3
'nodes':
4
[
5
{"id": "A", "x": 318.8422213150305, "y": 143.43172974910973},
6
{"id": "B", "x": 318.8422213150305, "y": 340.37375738590504},
7
{"id": "C", "x": 495.06062895771186, "y": -59.07859870832982},
8
{"id": "D", "x": 665.0945279449907, "y": 143.43172974910973},
9
{"id": "E", "x": 665.0945279449907, "y": 340.37375738590504}
10
],
11
'edges': [
12
{'from': 'A', 'to': 'B'},
13
{'from': 'A', 'to': 'C'},
14
{'from': 'A', 'to': 'D'},
15
{'from': 'D', 'to': 'C'},
16
{'from': 'E', 'to': 'D'}
17
]
18
};
19
20
var chart = anychart.graph();
21
chart.data(data);
22
chart.title().enabled(true).text('Fixed layout');
23
24
var layout = chart.layout();
25
26
layout.type('fixed');
27
28
chart.container('container').draw();
29
});