Closed 1zilc closed 3 years ago
感谢作者的项目,大大方便了我的工作内容 我在使用时发现直接设置option可以渲染,但是通过实例去setOption,会无显示内容
const Chart = () => { const chartRef = useRef<EChart>(null); useEffect(() => { chartRef.current?.setOption({ xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], }, yAxis: { type: 'value', }, series: [ { data: [820, 932, 901, 934, 1290, 1330, 1320], type: 'line', smooth: true, }, ], }); }, []); return ( <View style={{ height: 300 }}> <EChart ref={chartRef} echarts={echarts} option={{}} /> </View> ); };
"@tarojs/cli": "3.3.7", "@tarojs/taro": "3.3.7", "techarts": "^3.0.4", "react": "^17.0.0", "echarts": "5.2.1", 微信库: 2.19.5
不好意思,初始化option配置有问题,现在已经解决了
描述
感谢作者的项目,大大方便了我的工作内容 我在使用时发现直接设置option可以渲染,但是通过实例去setOption,会无显示内容
截图
代码片段
版本信息
"@tarojs/cli": "3.3.7", "@tarojs/taro": "3.3.7", "techarts": "^3.0.4", "react": "^17.0.0", "echarts": "5.2.1", 微信库: 2.19.5