f2react
v1.0.7
Published
use f2 in react
Downloads
20
Maintainers
Readme
f2react
简单封装 F2 以便在React中使用.
示例Demo
组件安装
$ npm i @antv/f2 --save
$ npm i f2react --save
组件使用
import createF2 from 'f2react';
const data = [
{ x: '1951 年', y: 38 },
{ x: '1952 年', y: 52 },
{ x: '1956 年', y: 61 },
{ x: '1957 年', y: 145 },
{ x: '1958 年', y: 48 },
{ x: '1959 年', y: 38 },
{ x: '1960 年', y: 38 },
{ x: '1962 年', y: 38 },
];
const Bar = createF2((chart) => {
chart.interval().position('x*y');
chart.render();
});
React.render(
<Bar
width={this.state.width}
height={this.state.height}
data={data}
/>
);
属性说明
详细使用见 f2 的官方API