<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" name=”viewport” content=”width=device-width, initial-scale=1″ >
<title>ECharts</title>
<!-- 引入 echarts.js -->
<script src="echarts.js"></script>
</head>
<body style=" height: 100%;width: auto;white-space: nowrap;">
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="main" style=" height: 500px;width: auto; white-space: nowrap">
</div>
<script type="text/javascript">
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
var i = 1;
option = {
title: {
text: ''
},
tooltip: {},
animationDurationUpdate: 5000,
animationEasingUpdate: 'quinticInOut',
series : [
{
type: 'graph',
layout: 'none',
symbolSize: 50,
roam: true,
label: {
normal: {
show: true
}
},
edgeSymbol: ['circle', 'arrow'],
edgeSymbolSize: [4, 10],
edgeLabel: {
normal: {
textStyle: {
fontSize: 20
}
}
},
data: [
{
name: '漏洞1',
x: 300,
y: 300
},
{
name: '漏洞2',
x: 500,
y: 500
},
],
// links: [],
links: [{
symbolSize: [5, 20],
label: {
normal: {
show: true
}
},
lineStyle: {
normal: {
width: 5,
curveness: 0.2
}
}
}, {
source: '漏洞1',
target: '漏洞2',
label: {
normal: {
show: true
}
},
lineStyle: {
normal: { curveness: 0.2 }
}
}, {
source: '漏洞2',
target: '漏洞1',
label: {
normal: {
show: true
}
},
}, ],
lineStyle: {
normal: {
opacity: 0.9,
width: 2,
curveness: 0
}
}
}
]
};
myChart.setOption(option);
</script>
</body>
</html>
拖鞋_