Skip to content

Instantly share code, notes, and snippets.

@sampsyo
Created February 15, 2017 19:41
Show Gist options
  • Save sampsyo/13432d60d4048bf705c1fb23e7005cd6 to your computer and use it in GitHub Desktop.
Save sampsyo/13432d60d4048bf705c1fb23e7005cd6 to your computer and use it in GitHub Desktop.
Dominik's example with a reference line at the average
{
"description": "A simple bar chart with embedded data.",
"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}
]
},
"layers": [
{
"mark": "bar",
"encoding": {
"x": {"field": "a","type": "ordinal"},
"y": {"field": "b","type": "quantitative"}
}
},
{
"mark": "rule",
"config": {"mark": {"color": "#000"}},
"encoding": {
"y": {"type": "quantitative", "field": "b", "aggregate": "mean"}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment