# f2 **Repository Path**: smdbs2000/f2 ## Basic Information - **Project Name**: f2 - **Description**: 基于 HTML5 Canvas,开箱即用的移动端可视化解决方案 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: https://antv.alipay.com/zh-cn/f2/3.x/index.html - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 122 - **Created**: 2019-05-27 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README  [](https://travis-ci.org/antvis/f2)   [](https://www.npmjs.com/package/@antv/f2) [](https://npmjs.org/package/@antv/f2) [](http://isitmaintained.com/project/antvis/f2 "Percentage of issues still open") F2,一个专注于移动,开箱即用的可视化解决方案,完美支持 H5 环境同时兼容多种环境(node, 小程序,weex)。完备的图形语法理论,满足你的各种可视化需求。专业的移动设计指引为你带来最佳的移动端图表体验。








## 文档
- [使用教程](https://antv.alipay.com/zh-cn/f2/3.x/tutorial/index.html)
- [API](https://antv.alipay.com/zh-cn/f2/3.x/api/index.html)
- [图表示例](https://antv.alipay.com/zh-cn/f2/3.x/demo/index.html)
## 快速开始
```html
```
```js
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: 'c1',
width: 375,
height: 265,
pixelRatio: window.devicePixelRatio
});
chart.source(data);
chart.interval().position('year*sales');
chart.render();
```
更多示例:[demos](https://antv.alipay.com/zh-cn/f2/3.x/demo/index.html)。
**手机扫码观看 demos**
## 本地开发
```bash
$ npm install
# 跑测试用例
$ npm run test-live
# 监听文件变化构建,并打开 demo 页面
$ npm run dev
# 打开 demo
$ npm run demos
# 按需打包
$ npm run bundler
```
## 如何贡献
如果您在使用的过程中碰到问题,可以先通过 [issues](https://github.com/antvis/f2/issues) 看看有没有类似的 bug 或者建议。
如需提交代码,请遵从我们的[贡献指南](https://github.com/antvis/f2/blob/master/CONTRIBUTING.md)。
## License
[MIT license](./LICENSE).