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 stage = acgraph.create('container');
3
var chart1 = anychart.graph();
4
chart1.data(data);
5
chart1.title().enabled(true).text('Edges interactivity is disabled. \n One path for all edges. \n Edge\'s tooltip is unavailable.');
6
chart1.bounds(0, 0, '50%', '100%');
7
chart1.interactivity().edges(false);
8
9
var chart2 = anychart.graph(data);
10
chart2.title().enabled(true).text('Edges interactivity is enabled. \n Each edge has own path. \n Edge\'s tooltip works fine.');
11
chart2.bounds('50%', 0, '50%', '100%');
12
chart2.interactivity().edges(true);
13
14
chart2.container(stage).draw();
15
chart1.container(stage).draw();
16
});
17
var data = {
18
nodes: [
19
{"id": "a"},
20
{"id": "a1"},
21
{"id": "a2"},
22
{"id": "a3"},
23
{"id": "a4"},
24
{"id": "a5"},
25
{"id": "a6"},
26
{"id": "b"},
27
{"id": "b1"},
28
{"id": "b2"},
29
{"id": "b3"},
30
{"id": "b4"},
31
{"id": "b5"},
32
{"id": "b6"}
33
],
34
edges: [
35
{from: 'a', to: 'b'},
36
{from: 'a', to: 'a1'},
37
{from: 'a', to: 'a2'},
38
{from: 'a', to: 'a3'},
39
{from: 'a', to: 'a4'},
40
{from: 'a', to: 'a5'},
41
{from: 'a', to: 'a6'},
42
{from: 'b', to: 'b1'},
43
{from: 'b', to: 'b2'},
44
{from: 'b', to: 'b3'},
45
{from: 'b', to: 'b4'},
46
{from: 'b', to: 'b5'},
47
{from: 'b', to: 'b6'},
48
]
49
};