apache / echarts

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

[Bug] Series type "graph" doesn't render with "coordinateSystem" set to "geo" #18606

Closed bk-m closed 1 year ago

bk-m commented 1 year ago

Version

5.4.2

Link to Minimal Reproduction

Link

Steps to Reproduce

  1. Load geoJson and register it as a map with eCharts
  2. create options with "geo" using the registered map and add a series of type "graph" with "coordinateSystem" set to "geo" and "geoIndex" set to "0". (The data of the series does not matter, pick something.)
  3. With "coordinateSystem" set to "geo" the graph will not render. If you comment out the "coordinateSystem" it will render.

Current Behavior

When setting the "coordinateSystem" of a "graph" series to "geo" the graph will no longer render.

Expected Behavior

Considering the documentation lists "coordinateSystem: 'geo'" as an option for graph series, I would expect it to work just like with a scatter series https://echarts.apache.org/examples/en/editor.html?c=geo-svg-scatter-simple

Environment

OS: Manjaro
Browser: Firefox 113.0
Framework: eCharts 5.4.2

Any additional comments?

No response

helgasoft commented 1 year ago

Graph series work with "geo", but lines are more popular. Link edges can be defined as indexes only, I could not find how to do names. So unfortunately edgeLabel only shows (irrelevant) node indexes, not names. Demo Code image

plainheart commented 1 year ago

I could not find how to do names

To make it work, you may have to organize the data in the following form.

{
  value:[-82.7128, 30.0060, 60],
  name: 'Node 2'
},
{
  value:[-82.7128, 40.0060, 100],
  name: 'Node 3'
}
bk-m commented 1 year ago

I tried for hours to get this to work, but it just wouldn't. In fact, I tried so many different things, I don't even know what I did wrong. Anyway, this seems to work. Thanks alot!

To make it work, you may have to organize the data in the following form.

I can confirm that explicitly setting the name attribute on nodes allows edge creation by name.