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