Published
Edited
Nov 5, 2021
1 fork
Insert cell
# Bar Chart
Insert cell
renderBarChart(data, {
labelColumn: 'key',
dataColumn: 'value'
})

Insert cell
data = [{key: "A", value: 142},{key: "B", value: 32},{key: "C", value: 123},{key:"D", value: 2}]
Insert cell
renderBarChart = function renderBArChart(data,label) {
let x = label.labelColumn;
let y = label.dataColumn;
return Plot.plot({
marks: [
Plot.barY(data, {x: x, y: y})
]
})
}
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