apache / echarts

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

[Bug] 微信小程序端没有 DOMParser这个构造函数 #19406

Open Arc-zlz opened 10 months ago

Arc-zlz commented 10 months ago

Version

5..4.3

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=geo-organ

Steps to Reproduce

在使用svg/geoJson 数据渲染canvas时 微信小程序端无法使用echart.registerMap()方法注册,会报错没有 DOMParser这个构造函数, 原因是微信小程序环境没有web api

Current Behavior

在使用svg/geoJson 数据渲染canvas时 微信小程序端无法使用echart.registerMap()方法注册,会报错没有 DOMParser这个构造函数, 原因是微信小程序环境没有web api

Expected Behavior

请问有什么方法可是避开使用echart.registerMap()方法或者怎么本地引入geoJson数据

Environment

- OS:
- Browser:
- Framework:1

Any additional comments?

1

echarts-bot[bot] commented 10 months ago

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

TRANSLATED
**TITLE** [Bug] There is no constructor of DOMParser on the WeChat Mini Program side **BODY** ### Version 5..4.3 ### Link to Minimal Reproduction https://echarts.apache.org/examples/zh/editor.html?c=geo-organ ### Steps to Reproduce When using svg/geoJson data to render canvas, the WeChat Mini Program cannot be registered with the echart.registerMap() method, and an error message will be reported that there is no DOMParser constructor, because the WeChat Mini Program environment does not have a web api ### Current Behavior When using svg/geoJson data to render canvas, the WeChat Mini Program cannot be registered with the echart.registerMap() method, and an error message will be reported that there is no DOMParser constructor, because the WeChat Mini Program environment does not have a web api ### Expected Behavior Is there any way to avoid using the echart.registerMap() method or how to import geoJson data locally? ### Environment ```markdown - OS: - Browser: - Framework:1 ``` ### Any additional comments? 1
Arc-zlz commented 10 months ago

can you help me?

Ovilia commented 10 months ago

@Arc-zlz You are welcomed to make a pull request. Otherwise, waiting for the community to fix may take longer time because you need to wait for someone interested in fixing this.