elvinzhu / techarts

An out of the box Taro component for ECharts
69 stars 20 forks source link

在 iphone6 IOS 11.0.03 微信版本7.0.8中崩溃 #22

Closed wangrui97 closed 2 years ago

wangrui97 commented 3 years ago

Taro 2.2.15

elvinzhu commented 3 years ago

图表宽高设置的过大?

wangrui97 commented 3 years ago
<EChart echarts={echarts} option={option} onInit={this.onInit} />

onInit = (canvas, width, height, dpr) => {
    const chart = echarts.init(canvas, null, {
      width: width,
      height: height,
      devicePixelRatio: dpr, // new
    });
    canvas.setChart(chart);
    chart.setOption(this.state.option);
    return chart; // 必须return
  };

我现在调的这种方式,没看到哪里可以设置宽高呢

elvinzhu commented 3 years ago

信息有限,很难定位问题,你自己先从以下方面试下

  1. 去除 techart,看是否崩溃
  2. 是否有频繁 render
  3. echarts 如果是全量的,试下自定义构建
  4. echarts 换一种调用方式
  5. 检查图表宽高是否设置的过大

以上如果不行的话,源码copy一份到项目中,加log排查下

elvinzhu commented 2 years ago

未收到更多反馈,关闭