桑基图文字要自上而下显示
option = {
series: {
type: 'sankey',
layout: 'none',
top: '30%',
data: [
{ name: '班级A' },
{ name: '班级B' },
{ name: '班级C' },
{ name: '班级D' }
],
links: [
{ source: '班级A', target: '班级B', value: 10 },
{ source: '班级B', target: '班级C', value: 15 },
{ source: '班级C', target: '班级D', value: 20 }
],
orient: 'vertical',
levels: [{
label: {
position: 'top',
distance: 10,
// rotate:-90,
formatter: (params) => {
return params.name.split('').join('\n');
},
},
depth: 0
},{
label: {
position: 'top',
distance: 13.5
},
depth: 1
},{
label: {
position: 'bottom',
distance: 13.5
},
depth: 2
},{
label: {
show: true,
position: 'bottom',
distance: 13.5
},
depth: 3
}]
}
};