Skip to content

Instantly share code, notes, and snippets.

@kristw
Last active September 9, 2020 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristw/2d76a7d86b9ed58a82ec6afed09884ea to your computer and use it in GitHub Desktop.
Save kristw/2d76a7d86b9ed58a82ec6afed09884ea to your computer and use it in GitHub Desktop.
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"width": 400,
"data": {"url": "data/ohlc.json"},
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"title": "Date"
},
"y": {
"type": "quantitative",
"scale": {"zero": false},
"title": "Price"
},
"color": {
"condition": {
"test": "datum.open < datum.close",
"value": "#06982d"
},
"value": "#ae1325"
}
},
"layer": [
{
"mark": "rule",
"encoding": {
"y": {"field": "low"},
"y2": {"field": "high"}
}
},
{
"mark": "bar",
"encoding": {
"y": {"field": "open"},
"y2": {"field": "close"}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment