-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-graph.html
More file actions
28 lines (25 loc) · 1.36 KB
/
basic-graph.html
File metadata and controls
28 lines (25 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ECharts Demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.2.2/echarts.min.js"
integrity="sha512-ivdGNkeO+FTZH5ZoVC4gS4ovGSiWc+6v60/hvHkccaMN2BXchfKdvEZtviy5L4xSpF8NPsfS0EVNSGf+EsUdxA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
#display-container {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="display-container">
</div>
<script type="text/javascript">
let chart = echarts.init(document.getElementById("display-container"));
let option = {"series":[{"type":"graph","data":[{"name":"Node 1","x":300,"y":300},{"name":"Node 2","x":800,"y":300},{"name":"Node 3","x":550,"y":100},{"name":"Node 4","x":550,"y":500}],"symbolSize":50,"links":[{"lineStyle":{"curveness":0.2},"source":"Node 1","target":"Node 2"},{"lineStyle":{"curveness":0.2},"source":"Node 2","target":"Node 1"},{"source":"Node 1","target":"Node 3"},{"source":"Node 2","target":"Node 3"},{"source":"Node 2","target":"Node 4"},{"source":"Node 1","target":"Node 4"}],"edgeSymbol":["circle","arrow"],"label":{"show":true},"lineStyle":{"width":2,"opacity":0.9,"curveness":0}}]}
chart.setOption(option);
</script>
</body>
</html>