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.onDocumentReady(function () {
2
3
// create data
4
var data = {
5
nodes: [
6
{id: "Richard"},
7
{id: "Larry"},
8
{id: "Marta"},
9
{id: "Jane"},
10
{id: "Norma"},
11
{id: "Frank"},
12
{id: "Brett"},
13
{id: "Tommy"}
14
],
15
edges: [
16
{from: "Richard", to: "Larry"},
17
{from: "Richard", to: "Marta"},
18
{from: "Larry", to: "Marta"},
19
{from: "Marta", to: "Jane",
20
normal: {stroke: {
21
color: "#ffa000",
22
thickness: "2",
23
dash: "10 5",
24
lineJoin: "round"
25
}
26
},
27
hovered: {stroke: {
28
color: "#ffa000",
29
thickness: "4",
30
dash: "10 5",
31
lineJoin: "round"
32
}
33
},
34
selected: {stroke: "4 #ffa000"}
35
},
36
{from: "Jane", to: "Norma"},
37
{from: "Jane", to: "Frank"},
38
{from: "Jane", to: "Brett"},
39
{from: "Brett", to: "Frank"}
40
]
41
};
42
43
// create a chart and set the data
44
var chart = anychart.graph(data);
45
46
// prevent zooming the chart with the mouse wheel
47
chart.interactivity().zoomOnMouseWheel(false);
48
49
// set the chart title
50
chart.title("Network Graph: Appearance Individual Edges");
51
52
// set the container id
53
chart.container("container");
54
55
// initiate drawing the chart
56
chart.draw();
57
});