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 chart = anychart.graph();
3
chart.data(data);
4
chart.title().enabled(true).text('Enable arrows');
5
6
// Enable arrows.
7
chart.edges().arrows().enabled(true);
8
9
chart.container('container').draw();
10
});
11
12
var data = {
13
nodes: [
14
{"id": "a"},
15
{"id": "a1"},
16
{"id": "a2"},
17
{"id": "a3"},
18
{"id": "a4"},
19
{"id": "a5"},
20
{"id": "a6"},
21
{"id": "b"},
22
{"id": "b1"},
23
{"id": "b2"},
24
{"id": "b3"},
25
{"id": "b4"},
26
{"id": "b5"},
27
{"id": "b6"}
28
],
29
edges: [
30
{from: 'a', to: 'b'},
31
{from: 'a', to: 'a1'},
32
{from: 'a', to: 'a2'},
33
{from: 'a', to: 'a3'},
34
{from: 'a', to: 'a4'},
35
{from: 'a', to: 'a5'},
36
{from: 'a', to: 'a6'},
37
{from: 'b', to: 'b1'},
38
{from: 'b', to: 'b2'},
39
{from: 'b', to: 'b3'},
40
{from: 'b', to: 'b4'},
41
{from: 'b', to: 'b5'},
42
{from: 'b', to: 'b6'},
43
]
44
};