echart 能量图
时间: 2023-07-23 16:17:55 浏览: 151
ECharts(百度开源的一个数据可视化库)中的能量图(Sankey Diagram)可以用于展示能量、物质、信息等在不同阶段之间的流动情况。以下是一个简单的能量图示例:
```javascript
option = {
title: {
text: '能量图示例'
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c}"
},
series: [
{
type: 'sankey',
layout: 'none',
data: [
{name: '能量1'},
{name: '能量2'},
{name: '能量3'},
{name: '能量4'},
{name: '能量5'},
{name: '能量6'}
],
links: [
{source: '能量1', target: '能量2', value: 10},
{source: '能量1', target: '能量3', value: 8},
{source: '能量2', target: '能量4', value: 6},
{source: '能量2', target: '能量5', value: 4},
{source: '能量3', target: '能量4', value: 3},
{source: '能量3', target: '能量5', value: 5},
{source: '能量4', target: '能量6', value: 9},
{source: '能量5', target: '能量6', value: 7}
],
lineStyle: {
opacity: 0.5,
curveness: 0.5
}
}
]
};
```
可以通过 ECharts 官网提供的在线编辑器进行实时预览和调试。
阅读全文