Skip to main content
100%

G2: The Grammar of Graphics in JavaScript

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Nov 27, 2017
Created on Nov 27, 2017

A bar chart displays categorical sales data for five video game genres, using colored intervals to encode each genre’s sold quantity. The G2 library renders the visualization into a canvas element, with the chart configured through its JavaScript API: `new G2.Chart` sets the container and dimensions, while `chart.interval().position('genre*sold')` maps the data fields to the x and y axes. The chart’s source data is passed via `chart.source(data)`, and `chart.render()` draws the final result.

AI-generated description

G2: The Grammar of Graphics in JavaScript https://github.com/antvis/g2

Examples a gogo @ https://antv.alipay.com/zh-cn/g2/3.x/demo/index.html

mit Licensed

Similar vizzes