d2recharts
Version:
data driven react components of echarts
66 lines (45 loc) • 1.1 kB
Markdown
d2recharts
==========
**Data Driven** echarts wrapped as react components.

To make the path from data to chart shorter.
```shell
npm i d2recharts --save
```
A typical use case is like:
```jsx
<D2Pie
data={[
{value:335, name:'直接访问'},
{value:310, name:'邮件营销'},
{value:234, name:'联盟广告'},
{value:135, name:'视频广告'},
{value:1548, name:'搜索引擎'}
]}
/>
```
Simplest use case:
```jsx
const data = [
// data goes here
];
<D2RechartsSmart data={data} />
```
If you want fully functionality of echarts:
```jsx
const option = {
// echarts option goes here
};
<D2Recharts option={option} />
```
* [echarts](https://github.com/ecomfe/echarts): one of the greatest open source project for graphing.
* [echarts-for-react](https://github.com/hustcc/echarts-for-react): where the core react wrapping is stolen from.