1.0.2 • Published 5 years ago

antv-f2-react v1.0.2

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

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}
  />
);

属性说明