apache / echarts

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

关系图graph在使用geo坐标系统时报错:Cannot read property 'off' of undefined #14463

Closed datageartech closed 1 year ago

datageartech commented 3 years ago

Version

5.0.2

Steps to reproduce

  1. 打开ECharts官网示例

https://echarts.apache.org/examples/zh/editor.html?c=map-HK

  1. 将示例代码中的
myChart.setOption(option = {
...
});

改为:

myChart.setOption(option = {
    "title": {"text": "关系地图"},
    "tooltip": {"trigger": "item"},
    "geo": {"roam": true,"map": "HK"},
    "legend": {"data": ["C1","C2","C0"]},
    "series": 
    [
        {
            "name": "关系地图",
            "type": "graph",
            "layout": 'none',
            "coordinateSystem": "geo",
            "data":
            [
                {"name": "a","x": 114.14,"y": 22.28,"category": 0,"value": 80,"symbolSize": 16},
                {"name": "b","x": 114.18,"y": 22.30,"category": 0,"value": 140,"symbolSize": 30},
                {"name": "c","x": 114.18,"y": 22.25,"category": 1,"value": 70,"symbolSize": 14},
                {"name": "d","x": 114.23,"y": 22.18,"category": 2,"value": 5,"symbolSize": 6},
                {"name": "e","x": 114.25,"y": 22.35,"category": 2,"value": 55,"symbolSize": 11}
            ],
            "links":
            [
                {"source": 0,"target": 1},
                {"source": 1,"target": 2},
                {"source": 1,"target": 3},
                {"source": 1,"target": 4}
            ],
            "legendHoverLink": true,
            "label": {"position": "right"},
            "emphasis": {"focus": "adjacency"},
            "categories": [{"name": "C1"},{"name": "C2"},{"name": "C0"}],
            "lineStyle":
            {
                "color": 'source',
                "curveness": 0.3
            }
        }
      ]
    });
  1. 点击【运行】按钮

What is expected?

在地图中显示关系图

What is actually happening?

没有显示效果,打开浏览器控制台报错:

echarts.min.js:45 Uncaught TypeError: Cannot read property 'off' of undefined
    at echarts.min.js:45
    at t.eachNode (echarts.min.js:45)
    at e.render (echarts.min.js:45)
    at t.progress (echarts.min.js:45)
    at t._doProgress (echarts.min.js:45)
    at t.perform (echarts.min.js:45)
    at echarts.min.js:45
    at e.<anonymous> (echarts.min.js:45)
    at Array.forEach (<anonymous>)
    at P (echarts.min.js:35)
echarts-bot[bot] commented 3 years ago

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 dev@echarts.apache.org. Please attach the issue link if it's a technical question.

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

Have a nice day! 🍵

echarts-bot[bot] commented 3 years ago

@datageartech It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** Relationship graph GRAPH In the use of GEO coordinate system error: Cannot Read Property 'Off' of undefined **BODY** ### Version 5.0.2 ### steps to reproduce 1. Open the Echarts official website example https://echarts.apache.org/examples/zh/Editor.html?c=map-hk 2. Put the sample code `` ` MyChart.Setoption (option = { ... }); `` ` Change to: `` ` MyChart.Setoption (option = { "Title": {"text": "Relationship Map"}, "Tooltip": {"Trigger": "item"}, "GEO": {"Roam": True, "Map": "hk"}, "legend": {"DATA": ["C1", "C2", "C0"]}, "series": [ { "Name": "Relationship Map", "Type": "graph", "Layout": 'None', "CoordinateSystem": "GEO", "Data": [ {"Name": "a", "x": 114.14, "y": 22.28, "category": 0, "Value": 80, "SMBOLSIZE": 16}, {"Name": "B", "X": 114.18, "Y": 22.30, "Category": 0, "Value": 140, "Symbolsize": 30}, {"Name": "C", "X": 114.18, "Y": 22.25, "Category": 1, "Value": 70, "Symbolsize": 14}, {"Name": "D", "X": 114.23, "Y": 22.18, "Category": 2, "Value": 5, "Symbolsize": 6}, {"Name": "X": 114.25, "Y": 22.35, "Category": 2, "Value": 55, "SMBOLSIZE": 11} ], "links": [ {"Source": 0, "Target": 1}, {"Source": 1, "Target": 2}, {"Source": 1, "Target": 3}, {"Source": 1, "Target": 4} ], "LegendHoverLink": True, "label": {"position": "right"}, "EMPHASIS": {"focus": "adjacency"}, "categories": [{"name": "c1"}, {"name": "c2"}, {"name": "c0"}], "LINESTYLE": { "Color": 'Source', "curveness": 0.3 } } ] }); `` ` 3. Click the [Run] button ### What is expected? Display relationship map in the map ### What is actually happens? No display, open the browser console message: `` ` Echarts.min.js: 45 Uncaught TypeError: Cannot Read Property 'Off' of undefined At echarts.min.js: 45 AT T. EachNode (Echarts.min.js: 45) At E.Render (Echarts.min.js: 45) At T.Progress (Echarts.min.js: 45) AT T._DOPROGRESS (Echarts.min.js: 45) At T.Perform (Echarts.min.js: 45) At echarts.min.js: 45 at e. (echarts.min.js: 45) AT ARRAY.FOREACH () AT P (Echarts.min.js: 35) `` `
Etering commented 3 years ago

同问

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 1 year ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

helgasoft commented 1 year ago

solution - Demo Code