1 Star 0 Fork 59

yan5845hao / G2

forked from antv / G2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
Weixing Zhang 提交于 2017-11-23 11:24 . Update README.md

G2: The Grammar of Graphics in JavaScript

NPM Package NPM Downloads Percentage of issues still open

G2 is a visualization grammar, a data-driven visual language with a high level of usability and scalability. It provides a set of grammars, takes users beyond a limited set of charts to an almost unlimited world of graphical forms. With G2, users can describe the visual appearance of a visualization just by one statement.

More details about G2.

Installation

npm install @antv/g2

Usage

<div id="c1"></div>
import G2 from '@antv/g2';

const data = [
  { genre: 'Sports', sold: 275 },
  { genre: 'Strategy', sold: 1150 },
  { genre: 'Action', sold: 120 },
  { genre: 'Shooter', sold: 350 },
  { genre: 'Other', sold: 150 },
];

const chart = new G2.Chart({
  container: 'c1',
  width: 500,
  height: 500
});

chart.source(data);
chart.interval().position('genre*sold').color('genre');
chart.render();

More examples

JavaScript
1
https://gitee.com/yan5845hao/g2.git
git@gitee.com:yan5845hao/g2.git
yan5845hao
g2
G2
master

搜索帮助