由于label的文字比较长,同时元素又比较多,所以想让文字垂直显示。但是没有找到方法
配置项如下
option = {
title: {
text: 'Graph 简单示例'
},
tooltip: {},
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',
series: [{
type: 'graph',
layout: 'none',
symbolSize: 50,
roam: true,
label: {
normal: {
show: true,
formatter: function (val) {
var a =val.name;
var b = [];
b = a.split("");
return b.join('\n');
}
}
},
data: [{
name: '节点1',
x: 300,
y: 300
}, {
name: '节点2',
x: 800,
y: 300
}, {
name: '节点3',
x: 550,
y: 100
}, {
name: '节点4',
x: 550,
y: 500
}],
}]
};