Skip to content

alwaysloseall/react-native-echarts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

important

这是一个 fork 自github.com/somonus/react-native-echarts的项目,主要为解决在项目中使用时遇到的一些 bug

native-echarts

NPM Version npm License

install

npm install @whir-react-native/echarts react-native-webview --save

or

yarn add @whir-react-native/echarts react-native-webview

Usage

The Usage is complete consistent with Echarts

component props:

  • option (object): The option for echarts: Documentation
  • width (number): The width of the chart. The default value is the outer container width.
  • height (number): The height of the chart. The default value is 400.
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View } from "react-native";
import Echarts from "native-echarts";

export default class app extends Component {
  render() {
    const option = {
      title: {
        text: "ECharts demo",
      },
      tooltip: {},
      legend: {
        data: ["销量"],
      },
      xAxis: {
        data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
      },
      yAxis: {},
      series: [
        {
          name: "销量",
          type: "bar",
          data: [5, 20, 36, 10, 10, 20],
        },
      ],
    };
    return <Echarts option={option} height={300} />;
  }
}

AppRegistry.registerComponent("app", () => app);

##Example

run demo

cd example
npm install
npm start

License

native-echarts is released under the MIT license.

About

Echarts for react-native. The react-naitve chart.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 97.8%
  • JavaScript 1.2%
  • Other 1.0%