Giter VIP home page Giter VIP logo

f2react's Introduction

f2react

简单封装 F2 以便在React中使用.

NPM version npm download

示例Demo

组件安装

$ npm i @antv/f2 --save
$ npm i f2react --save

组件使用

import React, { Component } from 'react';
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}
  />
);

若在React工程中使用,建议看examples里的例子。

属性说明

名称 类型 默认值 描述
width number(必须,若不使用autoWidth组件) 图表宽度
height number(必须) 图表高度
data arrayOf(object) (必须) 数据源
configs any createF2((chart, configs))中的参数

f2react's People

Contributors

beautycss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

simbel6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.