Published
Edited
Jan 22, 2022
3 forks
Insert cell
# Beeminder and G2P - Calendar view
Insert cell
html`<div id="container" style="height: 140px"></div>`
Insert cell
G2Plot = require('@antv/g2plot');

Insert cell
Insert cell
// 第一次默认渲染
plot = new G2Plot.P("container", {}, G2PlotCalendar.adaptor, {
...G2PlotCalendar.defaultOptions,
width: 800,
height: 120,
autoFit: false,
data: data.map(point => ({date: moment(point.timestamp*1000).format("YYYY-MM-DD"), value: point.value}))
})
Insert cell
plot.render()
Insert cell
Insert cell
moment = require("moment");
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