UNPKG

1.1 kBMarkdownView Raw
1d2recharts
2==========
3
4**Data Driven** echarts wrapped as react components.
5
6## what?
7
8![data-flow](doc/data-flow.png)
9
10## Why?
11
12To make the path from data to chart shorter.
13
14## Install
15
16```shell
17npm i d2recharts --save
18```
19
20## Usage
21
22A typical use case is like:
23
24```jsx
25<D2Pie
26 data={[
27 {value:335, name:'直接访问'},
28 {value:310, name:'邮件营销'},
29 {value:234, name:'联盟广告'},
30 {value:135, name:'视频广告'},
31 {value:1548, name:'搜索引擎'}
32 ]}
33/>
34```
35
36Simplest use case:
37
38```jsx
39const data = [
40 // data goes here
41];
42<D2RechartsSmart data={data} />
43```
44
45If you want fully functionality of echarts:
46
47```jsx
48const option = {
49 // echarts option goes here
50};
51<D2Recharts option={option} />
52```
53
54## [Demo](./demo)
55
56## [API](./doc/api.md)
57
58## [Roadmap](./doc/roadmap.md)
59
60## [Contributing](./doc/contributing.md)
61
62## Thanks to
63
64* [echarts](https://github.com/ecomfe/echarts): one of the greatest open source project for graphing.
65* [echarts-for-react](https://github.com/hustcc/echarts-for-react): where the core react wrapping is stolen from.