You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/10/12 13:11:36 UTC

[GitHub] [incubator-echarts] plainheart commented on issue #11363: Drawing a Topology

plainheart commented on issue #11363:
URL: https://github.com/apache/incubator-echarts/issues/11363#issuecomment-707111148


   I suppose that you could do this generally through the [`map`](https://echarts.apache.org/en/option.html#series-map) series or [`geo`](https://echarts.apache.org/en/option.html#geo) coordinate system component with a customized map type based on SVG.
   
   > Related issue: #4537 (in Chinese)
   
   **Step1: Register a customized map by the ECharts API [`echarts.registerMap`](https://echarts.apache.org/en/api.html#echarts.registerMap)**
   
   > Unfortunately, this usage seems not to be listed in the documentation. Maybe it's just forgotten or imperfect yet?
   
   ```js
   // use jQuery to fetch the svg document
   $.get('football.svg', function (svgDocument) {
    // register a football map
     echarts.registerMap('football', {
        svg: svgDocument
     }
   }
   ```
   
   **Step2: Use the customized map base on SVG in [`map`](https://echarts.apache.org/en/option.html#series-map)** series or [`geo`](https://echarts.apache.org/en/option.html#geo) component
   > see the option [`series-map.map`](https://echarts.apache.org/en/option.html#series-map.map) and the option [`geo.map`](https://echarts.apache.org/en/option.html#geo.map)
   ```js
   series: [{
           type: 'map',
           map: 'football'
   }]
   ```
   
   The result likes the screenshot (in Chinese)
   
   ![football map base on svg](https://user-images.githubusercontent.com/26999792/95221439-04f8e080-082a-11eb-9064-c70581a9ef3c.png)


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org