apache / apache/echarts

Missing total value of node in the formatter of sankey

Open
#11,459 9 comments 0 reactions 1 assignee Claimed by @deqingli View on GitHub
bug difficulty: easy topic: sankey topic: tooltip
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version
4.4.0

### Steps to reproduce
官方示例上只使用了自定义formatter
```js
myChart.showLoading();
$.get(ROOT_PATH 'data/asset/data/energy.json', function (data) {
myChart.hideLoading();

myChart.setOption(option = {
title: {
text: 'Sankey Diagram'
},
draggable: false,
tooltip: {
trigger: 'item',
formatter: function (params) {
// console.log(params)
if (params.dataType == 'node') {
console.log(params.value)
}
},
// triggerOn: 'mousemove'
},
series: [
{
type: 'sankey',
data: data.nodes,
links: data.links,
focusNodeAdjacency: 'allEdges',
itemStyle: {
normal: {
borderWidth: 1,
borderColor: '#aaa'
}
},
lineStyle: {
normal: {
color: 'source',
curveness: 0.5
}
}
}
]
});
});
```
### What is expected?
输出总数(params.value)

### What is actually happening?
undefined

---
默认是有总数的,使用自定义得不到该数据

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.