# G2Plot **Repository Path**: xsnxj/g2plot ## Basic Information - **Project Name**: G2Plot - **Description**: 简单、易用、并具备一定扩展能力和组合能力的统计图表库,基于图形语法理论搭建而成 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: https://github.com/antvis/g2plot - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 35 - **Created**: 2020-04-15 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README English | [简体中文](./README.zh-CN.md)

G2Plot

A charting library based on the Grammar of Graphics. [![Version](https://badgen.net/npm/v/@antv/g2plot)](https://www.npmjs.com/@antv/g2plot) [![NPM downloads](http://img.shields.io/npm/dm/@antv/g2plot.svg)](http://npmjs.com/@antv/g2plot) ![Latest commit](https://badgen.net/github/last-commit/antvis/g2plot) [![CI Status](https://github.com/antvis/G2Plot/workflows/CI/badge.svg?branch=master)](https://github.com/antvis/G2Plot/actions?query=workflow%3ACI) [![coverage](https://img.shields.io/coveralls/antvis/g2plot/master.svg)](https://coveralls.io/github/antvis/g2plot)
G2Plot is an interactive and responsive charting library. Based on [the grammar of graphics](https://github.com/antvis/g2), you can easily make superior statistical charts through a few lines of code.

## Features ### Pretty & Lightweight With [AntV](https://antv.vision/en) design principles of data visualization, G2Plot provides standard and elegant visual styles as well as neat config options.
### Responsive G2Plot guarantees the readability of the charts in different sizes and data.
### Storytelling With the feature of _layers_, charts can be grouped, nested or linked to do exploratory analysis and expressive storytelling.
## Installation ```bash $ npm install @antv/g2plot ``` ## Usage
```html
``` ```js import { Bar } from '@antv/g2plot'; const data = [ { year: '1951 年', sales: 38 }, { year: '1952 年', sales: 52 }, { year: '1956 年', sales: 61 }, { year: '1957 年', sales: 145 }, { year: '1958 年', sales: 48 }, ]; const bar = new Bar(document.getElementById('container'), { data, xField: 'sales', yField: 'year', colorField: 'year', }); bar.render(); ``` ## Contributing Your contributions are always welcome! Please Do have a look at the [issues](https://github.com/antvis/g2plot/issues) first. To become a contributor, please follow our [contributing guide](https://github.com/antvis/g2plot/blob/master/CONTRIBUTING.md). ## License MIT ## Links [ChartCube](https://chartcube.alipay.com/) - Online chart making tool based on G2Plot.