supervons / react-native-echarts-pro

A React-Native charts based on Apache ECharts, support various charts and map.
https://supervons.github.io/react-native-echarts-pro-docs/
MIT License
216 stars 32 forks source link

反馈几个问题 #92

Closed Robotboy36 closed 1 year ago

Robotboy36 commented 1 year ago

1, 轴 formatter 不支持函数, 只支持字符串模板方式 2, 实例未提供dispose方法

congshengwu commented 1 year ago

你好,关于第一点,x轴y轴是支持formatter函数的。请问你使用的react native版本是多少?是否启用了Hermes引擎?

如果启用Hermes引擎,所有函数包括formatter函数会被Hermes被转换为字节码然后注入到webview中去执行,这导致图表无法正常渲染。基于WebView的Echarts实现方案都会遇到这个问题。当然也有对应的解决方案。

可以根据这个链接里的模板提供一下你的信息:https://github.com/supervons/react-native-echarts-pro/issues/6

supervons commented 1 year ago

关于第二点,可以查看文档 getinstanceinstance 已经暴露出来,剩下的实例方法调用即可,如下:

echartsRef.current.getInstance("dispose");
chenhr24 commented 3 months ago

遇到了第一个问题,formater是直接写在option配置里的,表现是(调试模式下是正常展示的)打包后柱形不展示, "react-native-echarts-pro": "^1.9.0",