cometor opened a new issue #12220: 关系图(graph)自定义node的tooltip,导致edge的tooltip显示错误 URL: https://github.com/apache/incubator-echarts/issues/12220 ### Version 4.4.0 ### Steps to reproduce My option is like this: ```js option = { tooltip: {}, series: [ { type: 'graph', layout: 'none', symbolSize: 50, label: { show: true }, data: [{ name: 'A', x: 100, y: 100, tooltip: { formatter :function(params) { return 'this is A' } } }, { name: 'B', x: 300, y: 200 }, { name: 'C', x: 50, y: 250 }], links: [ { source: 'B', target: 'C' },{ source: 'B', target: 'A' }, { source: 'A', target: 'C' }] } ] }; ``` the actual chart is like this  I debugged it and found an error in `\src\component\tooltip\TooltipView.js` ```js _showSeriesItemTooltip: function (e, el, dispatchAction) { var ecModel = this._ecModel; // Use dataModel in element if possible // Used when mouseover on a element like markPoint or edge // In which case, the data is not main data in series. var seriesIndex = el.seriesIndex; var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link. var dataModel = el.dataModel || seriesModel; var dataIndex = el.dataIndex; var dataType = el.dataType; var data = dataModel.getData(); ``` `dataModel.getData()` always return the data of nodes, but not edges. ### What is expected? when hover to the edge 'B>C',the tooltip is ‘B>C’ ### What is actually happening? when hover to the edge 'B>C',the tooltip is ‘this is A’ <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
