Published
Edited
Dec 31, 2021
Fork of Untitled
1 fork
Insert cell
Insert cell
Insert cell
G2Plot = require("@antv/g2plot@1.0.1");
Insert cell
G2PlotBar = {
const container = document.createElement('div');
const data = coffee;

const stackedColumnPlot = new G2Plot.StackColumn(container, {
data,
xField: '饮品',
yField: 'value',
xAxis: false,
yAxis: false,
padding: [20, 20, 100, 50],
stackField: 'type',
interactions: [{ type: 'element-highlight-by-color' }, { type: 'element-link' }],
});

stackedColumnPlot.render();

return container;

}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more