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