https://github.com/pansyjs/react-charts
基于 G2Plot 的图表封装
https://github.com/pansyjs/react-charts
chart g2plot react
Last synced: 9 months ago
JSON representation
基于 G2Plot 的图表封装
- Host: GitHub
- URL: https://github.com/pansyjs/react-charts
- Owner: pansyjs
- Created: 2020-04-07T03:43:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:30:09.000Z (over 2 years ago)
- Last Synced: 2024-10-14T06:37:44.717Z (over 1 year ago)
- Topics: chart, g2plot, react
- Language: TypeScript
- Homepage: https://react-charts.now.sh
- Size: 554 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
react-charts
> 基于 [G2Plot](https://github.com/antvis/G2Plot) 封装的图表库
## ✨ 特性
- 💻 使用 TypeScript 构建,提供完整的类型定义文件
## 🏗 安装
```
// npm 安装
npm install --save @pansy/react-charts
// yarn 安装
yarn add @pansy/react-charts
```
## 🔨 使用
```
import React, { FC } from 'react';
import { Line } from '@pansy/react-charts';
const App: FC = () => {
const data = [
{ year: '1991', value: 3 },
{ year: '1992', value: 4 },
{ year: '1993', value: 3.5 },
{ year: '1994', value: 5 },
{ year: '1995', value: 4.9 },
{ year: '1996', value: 6 },
{ year: '1997', value: 7 },
{ year: '1998', value: 9 },
{ year: '1999', value: 13 },
];
const config = {
data,
xField: 'year',
title: {
visible: true,
text: '我是标题',
},
};
return (
);
};
export default App;
```