Skip to content
📱📈An elegant, interactive and flexible charting library for mobile.
JavaScript Other
Branch: master
Clone or download

Latest commit

Latest commit e211eb7 May 27, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github test: add onstart hooks test case Apr 23, 2020
bin chore: configuration update. Aug 8, 2018
bundler chore(dev): require on demand: bundler app Apr 20, 2018
demos feat: 添加漏斗图 Dec 21, 2019
docs fix: ?复?网的链接?题 Mar 19, 2020
examples Merge pull request #740 from antvis/3.5 Jan 12, 2020
site chore: fix site title Nov 25, 2019
src chore: release 3.6.4-beta.5 May 27, 2020
test fix: ?复rect radius大于?高时,图形绘制不正? May 27, 2020
.babelrc feat: 新?网基础配? Nov 4, 2019
.editorconfig fist add Sep 26, 2017
.eslintignore feat: 使用教程的文档迁移 Nov 5, 2019
.eslintrc fix: ?复事件删除的bug,并补充单测 Mar 4, 2020
.gitignore feat: 新?网基础配? Nov 4, 2019
.npmignore chore: npm包添加src源文件 Jan 6, 2020
.torch.compile.opts.js fist add Sep 26, 2017
.travis.yml feat: travis config Jul 23, 2019
CHANGELOG.md chore: release 3.6.3 Mar 30, 2020
CONTRIBUTING.md chore(contribute): add contribute.md Nov 27, 2017
CONTRIBUTING.zh-CN.md chore(contribute): add contribute.md Nov 27, 2017
LICENSE update license Jul 20, 2018
README.md docs: update links in README Nov 21, 2019
README.zh-CN.md docs: update links in README Nov 21, 2019
gatsby-browser.js site: ?复几个demo Nov 20, 2019
gatsby-config.js Merge pull request #740 from antvis/3.5 Jan 12, 2020
package.json chore: release 3.6.4-beta.5 May 27, 2020
webpack-dev.config.js fist add Sep 26, 2017
webpack.config.js chore: configuration update. Aug 8, 2018

README.md

npm package NPM downloads Percentage of issues still open

中文 README

F2 is born for mobile, developed for developers as well as designers. It is Html5 Canvas-based, and is also compatible with Node.js, Weex and React Native. Based on the grammar of graphics, F2 provides all the chart types you'll need. Our mobile design guidelines enable better user experience in mobile visualzation projects.

Special thanks to Leland Wilkinson, the author of The Grammar Of Graphics, whose book served as the foundation for F2 and G2.

Installation

$ npm install @antv/f2

Features

Born for mobile

  • Design for mobile: make data more alive and chart interactions more natural.

All the chart types you want

With the power of grammar of graphics, F2 supports data-driven 50+ chart types(the amount can be even more, which is depended on you) including classical charts such as line, column/bar chart, pie chart, scatter plot, gauges, etc. Additionally, F2 also provides feature-riched chart components, such as Tooltip, Legend and Guide.

Flexible and Interactive

We also provide developers with flexible extension mechanisms, including shape, animation, and interactive customization capabilities, as well as flexible styling to meet a variety of personalized charting requirements.

Links

Other libraries base on F2

  • ant-design-mobile-chart: Ant Design Mobile Chart based on F2. (React).
  • BizGoblin:Data visualization library based F2 and React.
  • VChart: Mobile Chart Components based on vux and F2. (Vue).
  • weex-chart: Chart components based on Weex and F2.

Demos

Chart Demos

Or just scan the below qrcode to see demos in mobile:

Getting Started

<canvas id="mountNode"></canvas>
import F2 from '@antv/f2';

const data = [
  { year: '1951', sales: 38 },
  { year: '1952', sales: 52 },
  { year: '1956', sales: 61 },
  { year: '1957', sales: 145 },
  { year: '1958', sales: 48 },
  { year: '1959', sales: 38 },
  { year: '1960', sales: 38 },
  { year: '1962', sales: 38 },
];
const chart = new F2.Chart({
  id: 'mountNode',
  width: 375,
  height: 265,
  pixelRatio: window.devicePixelRatio
});
chart.source(data);
chart.interval().position('year*sales');
chart.render();

Development

$ npm install

# run test case
$ npm run test-live

# build watching file changes and run demos
$ npm run dev

# run demos
$ npm run demos

# run pack
$ npm run bundler

How to Contribute

Please let us know how can we help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide.

Experience Improvement Program Description

Since version 3.1.12 (released on 2018-06-20), we add F2.track(true) method for our user experience improvement program. But now the program has finish, so we remove the method from F2 since version 3.3.4. We are very sorry if it has caused trouble for you.

License

MIT license.

You can’t perform that action at this time.