Insert cell
Insert cell
drawC3Graph(x, y, y2, 260, 200) // width, height
Insert cell
function drawC3Graph(x, y, y2, width = 480, height = 240) {
return c3({
size: {width: width, height: height},
data: {x: 'x',
columns: [x, y, y2],
axes: {'complex cases': 'y2'},
groups: [[y[0]]], // 'new cases'
types: {'new cases': 'bar'}
},
axis: {
x: {type: 'category', tick: {rotate: -45, multiline: false}, height: 40},
y: {label: {text: y[0], position: 'outer-middle'}},
y2: {show: true, min: 0, padding: {top: 0, bottom: 0},
label: {text: y2[0], position: 'outer-middle'}
}
},
//legend: {position: 'inset'},
});
}
Insert cell
Insert cell
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