/**
*
* 测试关系图 graph type
*
*/
var coors1 = [
['1', 0],
['2', 182],
['5', 290],
['6', 330],
['7', 310],
['10',300]
];
var data = [coors1];
var optionSeries = [];
for (var i = 0; i < data.length; i++) {
var links = data[i].map(function(item, j) {
return {
source: j,
target: j + 1
};
});
optionSeries.push({
name:'体重',
type:'line',
symbol:'circle',
itemStyle : {
normal : {
color:'#83BBF3',
lineStyle:{
color:'#83BBF3'
}
}
},
data:data[i]
});
}
option = {
xAxis: {
type: 'category',
boundaryGap: false,
data: ['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','29','30'],
axisLabel: {
show: true,
interval:0,
formatter: function (value, index) {
if(value%2 !=0) return value;
else return '';
}
}
},
yAxis: {
type:'value',
min:0,
max:400
},
series:optionSeries
};
官网类似链接: http://gallery.echartsjs.com/editor.html?c=xHy0T3mohZ