Skip to content

Instantly share code, notes, and snippets.



Created Mar 27, 2018
What would you like to do?
Vega-Lite Bl.ocks example
license: bsd-3-clause
"$schema": "",
"description": "A simple bar chart with embedded data.",
"width": 360,
"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": "ordinal"},
"y": {"field": "b", "type": "quantitative"}
<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
<script src=""></script>
<script src=""></script>
body {
font-family: sans-serif;
.vega-actions a {
padding: 0.2em;
<div id="vis"></div>
const spec = "bar.vl.json";
vegaEmbed('#vis', spec).catch(console.warn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.