apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.27k stars 19.61k forks source link

Missing total value of node in the formatter of sankey #11459

Open elephantme opened 4 years ago

elephantme commented 4 years ago

Version

4.4.0

Steps to reproduce

官方示例上只使用了自定义formatter

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


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

maple5233 commented 4 years ago

@deqingli 这个bug 4.5.0依旧存在呀

Ovilia commented 4 years ago

@maple5233 这一改动会在未来的 4.7.0 中发布

ytsukanov commented 2 years ago

Gentlemen, was this not fixed yet?

sankey-bug

Ovilia commented 2 years ago

I tested it and it remains to be a bug in the current version.

nabiila-29 commented 1 year ago

Gentlemen, was this not fixed yet?

sankey-bug

Hi, I tried to do the same thing. Add '{c}' as value for label. It works on tooltip but fails in label. Has this issue been solved?

image
Sletheren commented 1 year ago

anything about this? the issue still remains.

ThePhoenixBird commented 1 year ago

Can we get an update on this issue?

evertoncolling commented 1 year ago

Any news on this? Stumbled upon this issue today 😅

juanitoddd commented 11 months ago

Hello, I have the same issue