xiaochouniu1 2022-06-16 14:34 采纳率: 0%
浏览 18
已结题

基于涂鸦IOT项目的 RN项目 使用 echarts

基于涂鸦IOT项目的 RN项目 使用 echarts
问题相关代码

import React, { PureComponent } from 'react';
import { View, ScrollView, StyleSheet, Text, Image } from 'react-native';
import { TYSdk, Utils, TYText, Dialog } from 'tuya-panel-kit';
const { convertX: cx, convertY: cy } = Utils.RatioUtils;
import Res from '../../res';
import Echarts from 'native-echarts';
import { connect } from 'react-redux';

import { store } from '../../redux/configureStore';
import dpCodes from '../../config/dpCodes';
const option = {
  title: {
    text: 'ECharts demo'
  },
  tooltip: {},
  legend: {
    data: ['销量']
  },
  xAxis: {
    data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
  },
  yAxis: {},
  series: [{
    name: '销量',
    type: 'bar',
    data: [5, 20, 36, 10, 10, 20]
  }]
};
const {
  tempIndoor: tempIndoorCode,
  humidity: humidityCode,
  tvoc: tvocCode,
  eco2: eco2Code,
  filterDays: filterDaysCode,
  totalRuntime: totalRuntimeCode,
  totalPm: totalPmCode,
  mode: modeCode,
  speed: speedCode,
} = dpCodes;

class HomeStatView8 extends PureComponent {
  render() {
    const { devInfo = {} } = store.getState();
    const bottomDps = [];
    const dps = [];
    const shuju = store.getState().dpState
    return (
      <View style={styles.container}>
        <Text>123123</Text>
        <Echarts option={option} height={300} />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

export default connect(({ dpState }) => ({
  tempIndoor: dpState[tempIndoorCode],
  humidity: dpState[humidityCode],
  tvoc: dpState[tvocCode],
  eco2: dpState[eco2Code],
  filterDays: dpState[filterDaysCode],
  totalRuntime: dpState[totalRuntimeCode],
  totalPm: dpState[totalPmCode],
  mode: dpState[modeCode],
  speed: dpState[speedCode],
}))(HomeStatView8);

运行结果及报错内容

img

我想要达到的结果

如何处理这种情况 就是变成了代码 没有图表出来

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 6月24日
    • 创建了问题 6月16日

    悬赏问题

    • ¥15 pycharm运行main文件,显示没有conda环境
    • ¥15 易优eyoucms关于二级栏目调用的问题
    • ¥15 寻找公式识别开发,自动识别整页文档、图像公式的软件
    • ¥15 为什么eclipse不能再下载了?
    • ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
    • ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
    • ¥15 特定网页无法访问,已排除网页问题
    • ¥50 如何将脑的图像投影到颅骨上
    • ¥15 提问一个关于vscode相关的环境配置问题,就是输入中文但是显示不出来,代码在idea可以显示中文,但在vscode不行,不知道怎么配置环境
    • ¥15 netcore使用PuppeteerSharp截图