配置项如下
var links = [
{"source":'0',"target":'1'},
{"source":'1',"target":'2'},
{"source":'2',"target":'3'},
{"source":'3',"target":'0'},
{"source":'3',"target":'4'},
{"source":'4',"target":'5'},
{"source":'5',"target":''}
]
var datas = [
{
name: '0',
fixed: true,symbolSize: 28,
value: [0, 0]
},
{
name: '1',
fixed: true,symbolSize: 28,
value: [40, 20]
},{
name: '2',
fixed: true,symbolSize: 28,
value: [30, 30]
},{
name: '3',
fixed: true,symbolSize: 28,
value: [20, 40]
},{
name: '4',
fixed: true,symbolSize: 28,
value: [10, 50]
},{
name: '5',
fixed: true,symbolSize: 28,
value: [0, 60]
},
]
option = {
tooltip: {},
xAxis: {
type : 'value', show: false
},
yAxis: {
type : 'value',show: false, inverse: true
},
series: [
{
type: 'graph',
layout: 'none',
coordinateSystem: 'cartesian2d',
symbol: 'path://M512.434393 66.861804c-0.054235 0-0.109494 0-0.163729 0l-0.541329 0c-0.056282 0-0.109494 0-0.163729 0-191.363376 0.434905-346.930477 156.1115-346.930477 347.637582 0 188.810227 119.553886 338.510714 326.018192 532.535709 0.325411 0.434905 0.434905 0.977257 0.814552 1.302669 3.042289 3.260254 6.735401 5.432733 10.646478 6.843872 0.923022 0.325411 1.954515 0.325411 2.933819 0.543376 2.226714 0.542352 4.399193 1.412163 6.681166 1.412163 0.107447 0 0.161682-0.10847 0.270153-0.10847 0.109494 0 0.163729 0.10847 0.272199 0.10847 2.281973 0 4.455475-0.86981 6.681166-1.412163 0.977257-0.217964 2.010797-0.217964 2.933819-0.543376 3.90903-1.412163 7.605212-3.584642 10.646478-6.843872 0.379647-0.325411 0.488117-0.868787 0.813528-1.302669 206.464305-194.024995 326.019215-343.725482 326.019215-532.535709C859.364871 222.973304 703.796746 67.296709 512.434393 66.861804zM511.998465 596.247776c-101.193727 0-183.541223-82.347496-183.541223-183.596482 0-101.247962 82.347496-183.486988 183.541223-183.486988 101.195773 0 183.541223 82.238003 183.541223 183.486988C695.539688 513.901303 613.194238 596.247776 511.998465 596.247776z',
symbolSize: 20,
label: { show: true, textStyle: { color: '#2288fc', fontSize: 18 }, position: 'bottom' },
itemStyle: { color: '#2288fc' },
emphasis: { label: { show: false } },
edgeSymbol: ['circle', 'arrow'],
edgeSymbolSize: [1, 15],
lineStyle: {
// type: 'dashed',
color: 'red',
width: 3,
curveness: 0.2
},
zlevel: 1000,
data: datas,
links: links
}
]
};