Echarts for react-native. The react-naitve chart.
Go to file
WebBug d2895266f7
Merge pull request #1 from Anshiii/master
修复改变绘图容器的size后绘图区域大小没有变动的问题
2018-06-15 15:00:00 +08:00
example update readme 2016-11-03 10:55:11 +08:00
src 修复容器尺寸修改后绘图区域没有改变的bug 2018-06-15 14:44:15 +08:00
.gitignore 修复formatter里即使输入'\\n'也没有换行符的bug 2018-03-30 16:14:42 +08:00
LICENSE.md Update LICENSE.md 2016-10-21 11:38:41 +08:00
README.md Update README.md 2016-11-18 16:08:30 +08:00
package.json release 0.4.0 2017-12-08 16:46:36 +08:00

README.md

native-echarts

NPM Version npm License

install

$ npm install native-echarts --save

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

IOS

Open the xcode project in the ios directory and click run

screenshots

image

Android

Open the Android project in the android directory with Android Studio and click run.

screenshots

image

License

native-echarts is released under the MIT license.