Published
Edited
May 23, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Shows a graph of a given time series. Accepts C3 columns as argument
timeSeriesChart = {
// force dependencies
d3;
css;
return async function* (columns, {yOpts} = {}) {
const divId = 'tsg' + Math.floor(Math.random()*100000000)
const div = html`<div id="${divId}" style="height: 250px"></div>`
yield div
c3.generate({
bindto: '#' + divId,
data: {
x: 'x',
columns
},
axis: {
x: {
type: 'timeseries',
tick: { format: '%Y-%m-%d' }
},
y: {
label: {
text:'WAU'
},
...yOpts
}
}
})
}
}
Insert cell
Insert cell
Insert cell
DateInfo = browserify('date-info')
Insert cell
Insert cell
Insert cell
d3 = require("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js")
Insert cell
c3 = require("https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.18/c3.js")
Insert cell
Insert cell
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