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

安卓真机(huawei)和模拟器图表不显示 #86

Closed wms718 closed 3 months ago

wms718 commented 1 year ago

react-native-echarts-pro【1.8.9】 react-native version【0.70.5】 react-native-webview 【11.25.0】 Platform【android】 真机系统版本:安卓6

运行react-native-echarts-pro文档实例中的代码图表不显示(webview是可以正常加载网页的):

import React from "react";
import { View } from "react-native";
import RNEChartsPro from "react-native-echarts-pro";

export default function RNEPDemo() {
  const pieOption = {
    series: [
      {
        name: "Source",
        type: "pie",
        legendHoverLink: true,
        hoverAnimation: true,
        avoidLabelOverlap: true,
        startAngle: 180,
        radius: "55%",
        center: ["50%", "35%"],
        data: [
          { value: 105.2, name: "android" },
          { value: 310, name: "iOS" },
          { value: 234, name: "web" },
        ],
        label: {
          normal: {
            show: true,
            textStyle: {
              fontSize: 12,
              color: "#23273C",
            },
          },
        },
      },
    ],
  };
  return (
          <View style={{ height: 300, paddingTop: 25 , backgroundColor:'white'}}>
            <RNEChartsPro height={250} option={pieOption} />
          </View>
  );
}

效果如下: image

supervons commented 1 year ago

感谢反馈,已定位到问题,Android 6 版本浏览器内核对于 ES6 语法支持不全。

目前考虑使用 babel 进行转义,预计下个版本修复;