Echarts for react-native. The react-naitve chart.
Switch branches/tags
Clone or download
somonus Merge pull request #86 from RebelBIrd/master
添加一个主动刷新option的方法
Latest commit 3767dee Feb 22, 2018
Permalink
Failed to load latest commit information.
example update readme Nov 3, 2016
src Merge pull request #86 from RebelBIrd/master Feb 22, 2018
.gitignore init Oct 21, 2016
LICENSE.md Update LICENSE.md Oct 21, 2016
README.md Update README.md Nov 18, 2016
package.json release 0.4.0 Dec 8, 2017

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.