Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小米手机使用时程序崩溃 #87

Closed
lzjchina opened this issue Dec 4, 2022 · 2 comments
Closed

小米手机使用时程序崩溃 #87

lzjchina opened this issue Dec 4, 2022 · 2 comments
Labels
Toolong No response for more than two weeks

Comments

@lzjchina
Copy link

lzjchina commented Dec 4, 2022

import React, {useEffect, useRef, useState} from "react";
import {StyleSheet, Text, View} from "react-native";
import ECharts from "react-native-echarts-pro";

const LineChart = (props) => {

const chartRef = useRef(null);
const option = {
    backgroundColor: "white",
    title: [], //
    legend: {
        data: [],
        show: true,
        z: 3,
        icon: "roundRect",
        bottom: 15,
        itemWidth: 8,
        itemHeight: 8,
        textStyle: {
            fontSize: 10,
            color: 'gray'
        }
    },
    color: [
        "#0ac860",
        "#ed3333",
        "#2fa4ed",
        "#9e5ed9",
        "#00b0a7",
        "#ed3472",
        "#4878f9",
    ],
    tooltip: {
        trigger: "axis",

        axisPointer: {
            animation: false,
        },

    },
    xAxis: [{
        type: "time",
        splitLine: {
            show: true,
        },
        axisLine: {
            show: false,
        },
        axisTick: {
            show: false,
            interval: 3,
        },
        // maxInterval: 3 * 60 * 60 * 1000,
        axisLabel: {
            // 显示最大值和最小值
            showMinLabel: true,
            showMaxLabel: true,
            fontSize: 10,
            formatter: '{HH}:{mm}',
        },
    }],
    yAxis: [{}],
    series: [{
        name: "",
        type: "line",
        showSymbol: false,
        data: [],
        itemStyle: { normal: { opacity: 0 } },
        lineStyle: { normal: { opacity: 0 } },
        tooltip: {
            show: false,
            axisPointer: {
                type: "none",
            },
        },
    }],
}

return (
    <View style={{backgroundColor: 'white'}}>
        <ECharts
          ref={chartRef}
          option={option}
          height={300}
        />

    </View>
);

}

const styles = StyleSheet.create({
});

export default LineChart

@supervons
Copy link
Owner

请先参考下 issue 规范:#6 提供下必要信息。

@supervons
Copy link
Owner

目前有发现 WebviewandroidHardwareAccelerationDisabled={true} 属性开启会导致部分机型闪退,可以去掉代码里的这行试一下。
文件位置:src/components/Echarts/index.js Line 160.

@supervons supervons added the Toolong No response for more than two weeks label Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Toolong No response for more than two weeks
Projects
None yet
Development

No branches or pull requests

2 participants