Published
Edited
Feb 10, 2018
1 fork
1 star
Insert cell
Insert cell
vegalite({
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {"url": "https://vega.github.io/editor/data/barley.json"},
"width": 500, "height": 250,
"resolve": {"scale": {"color": "independent"}},
"layer": [
{"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative", "stack": "zero"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal"}}
},
{"mark": {"type": "text", "dx": -15, "dy": 3},
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative", "stack": "zero"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal", "scale": {"range": ["white"]}, "legend": null},
"text": {"aggregate": "sum", "field": "yield", "type": "quantitative", "format": ".1f"}}
}
]
})
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