加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

A very simple echarts(v3.0) wrapper for react.

发布时间:2020-12-15 03:31:38 所属栏目:百科 来源:网络整理
导读:echart-for-react A very simple echarts(v3.0) wrapper for react. https://github.com/hustcc/echarts-for-react install npm install echart-for-react How to run the demo: git clone git@github.com:hustcc/echarts-for-react.gitnpm installnpm start

echart-for-react

A very simple echarts(v3.0) wrapper for react. https://github.com/hustcc/echarts-for-react

install

npm install echart-for-react

How to run the demo:

git clone git@github.com:hustcc/echarts-for-react.git

npm install

npm start

then open http://127.0.0.1:8080/ in your browser. or see http://hustcc.github.io/echarts-for-react/

usage

Simple demo code: more can see: http://hustcc.github.io/echarts-for-react/

import React from 'react';
import ReactEcharts from '../src/echarts-for-react';

<ReactEcharts
    option={this.getOtion()} 
    height={300} 
    onEvents={onEvents} />

component props

  • option

the echart option config,can see http://echarts.baidu.com/option.html#title.

  • height

the height of echart. number,with px as it's unit.

  • onChartReady

when chart is ready,will callback the function with the echart object as it's paramter.

  • onEvents

binding the echarts event,will callback the function with the echart event parameter,and the echart object. e.g:

let onEvents = {
    'click': this.onChartClick,'legendselectchanged': this.onChartLegendselectchanged
}
...
<ReactEcharts
    option={this.getOtion()} 
    height={300} 
    onEvents={onEvents} />

for more event name,see: http://echarts.baidu.com/api.html#events

TODO

  1. theme props

  2. echart API

LICENSE

MIT

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读