Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sankey Diagram Edge's tooltip's content doesn't show as formatter define. #12006

Closed
Dabaitu2 opened this issue Jan 9, 2020 · 3 comments · Fixed by #12011
Closed

Sankey Diagram Edge's tooltip's content doesn't show as formatter define. #12006

Dabaitu2 opened this issue Jan 9, 2020 · 3 comments · Fixed by #12011
Assignees
Labels
en This issue is in English new-feature

Comments

@Dabaitu2
Copy link

Dabaitu2 commented Jan 9, 2020

Version

Steps to reproduce

myChart.showLoading();
const defaultFormatter = params => {
  return 'hello'
};
$.get('https://www.echartsjs.com/data/asset/data/energy.json', function (data) {
    myChart.hideLoading();

    myChart.setOption(option = {
        title: {
            text: 'Sankey Diagram'
        },
        tooltip: {
            trigger: 'item',
            triggerOn: 'mousemove'
        },
        series: [
            {
                type: 'sankey',
                data: data.nodes.map(n => ({
                    ...n,
                    tooltip: {
                        trigger: 'item',
                        formatter: defaultFormatter
                    }
                })),
                links: data.links,
                focusNodeAdjacency: 'allEdges',
                itemStyle: {
                    borderWidth: 1,
                    borderColor: '#aaa'
                },
                lineStyle: {
                    color: 'source',
                    curveness: 0.5
                }
            }
        ]
    });
});

What is expected?

When I hover all edges, the tooltip should show "hello".

What is actually happening?

some of the edges will show tooltips like 'A -- B' rather than 'hello'

@echarts-bot
Copy link

echarts-bot bot commented Jan 9, 2020

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical questions.

If you are interested in the project, you may also subscribe our mail list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jan 9, 2020
@susiwen8
Copy link
Contributor

susiwen8 commented Jan 9, 2020

Yes, it is a bug

@susiwen8 susiwen8 removed pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jan 9, 2020
@susiwen8
Copy link
Contributor

Actually, This might be a new feature, because right now edges'(links) tooltip are nodes'(datas) tooltip, It would be better to separate those two. That means add tooltip option for edges(links)
Just add a missing parameter at
https://github.com/apache/incubator-echarts/blob/master/src/component/tooltip/TooltipView.js#L486

@susiwen8 susiwen8 added new-feature and removed bug labels Jan 10, 2020
@susiwen8 susiwen8 self-assigned this Jan 10, 2020
100pah added a commit that referenced this issue Apr 21, 2020
Feature: add tooltip for edges(links) (#12006)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants