antv-f2-react
v1.0.2
Published
use @antv/f2 in React
Downloads
3
Maintainers
Readme
antv-f2-react
简单封装 @Antv/F2 以便在React中使用.
组件安装
$ npm i antv-f2-react -S
$ npm i antv-f2-react --save
组件使用
import React, { Component } from 'react';
import AntvF2React from "antv-f2-react";
const data = [
{ x: '1', y: 38 },
{ x: '2', y: 52 },
{ x: '3', y: 61 },
{ x: '4', y: 145 },
{ x: '5', y: 48 }
];
const Demo = AntvF2React((chart) => {
chart.interval().position('x*y');
chart.render();
});
React.render(
<Demo
width={this.state.width}
height={this.state.height}
data={data}
/>
);
属性说明
- 图表详细使用请查看 F2官方API