0.1.2 • Published 8 years ago

react-echarts-component v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

React Echarts Component

Echarts component for React

For details about how to use echarts. Please refer to http://echarts.baidu.com/

Types of charts supported/examples: http://echarts.baidu.com/examples.html

Installation

npm install --save react-echarts-component

Usage

// es6
import ReactEcharts from 'react-echarts-component'
// es5
var ReactEcharts = require('react-echarts-component')

<ReactEcharts
  height={400}
  option={{...}}
  showLoading={true} />

Props Taken:

  • height (required, number)

    height of the chart, unit: px

  • option (required, object)

    settings for the chart, for details, refer to http://echarts.baidu.com/option.html#title

  • showLoading (optional, bool, default: false)

    whether to show a spinning loader

  • onClick (optional, func)

    callback when data clicked

  • onReady (optional, func)

    callback when then chart is initialized, the echart instance is passed in, for detail, refer to http://echarts.baidu.com/api.html#echartsInstance

Development

git clone https://github.com/zillding/react-echarts-component.git
cd react-echarts-component
npm install
npm start
open http://localhost:3000

License

MIT