Public
Edited
Apr 29
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
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
render({data: { values: [
{"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
{"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
{"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}]},
mark: "bar",
encoding: {
x: {field: "a", type: "nominal", axis: {"labelAngle": 0}},
y: {field: "b", type: "quantitative"}
}
})

// Add this inside the "const spec = {}" if you are writing Vega-Lite in HTML
// data: { values: [
// {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
// {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
// {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}]},
// mark: "bar",
// encoding: {
// x: {field: "a", type: "nominal", axis: {"labelAngle": 0}},
// y: {field: "b", type: "quantitative"}
// }
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