Skip to content

Instantly share code, notes, and snippets.

@valk
Created October 1, 2020 22:41
Show Gist options
  • Save valk/16bb043ac9988692bc182ff49ec33e22 to your computer and use it in GitHub Desktop.
Save valk/16bb043ac9988692bc182ff49ec33e22 to your computer and use it in GitHub Desktop.
Small series chart with Vega
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"height": 60,
"width": 120,
"padding": 0,
"autosize": "fit",
"description": "Google's stock price over time.",
"data": {
"url": "data/stocks.csv"
},
"transform": [
{
"filter": "datum.symbol==='AAPL'"
}
],
"mark": {
"type": "area",
"line": {
"color": "#388d23",
"strokeWidth": 3
},
"color": {
"x1": 1,
"y1": 1,
"x2": 1,
"y2": 0,
"gradient": "linear",
"stops": [
{
"offset": 0,
"color": "white"
},
{
"offset": 1,
"color": "#388d23"
}
]
}
},
"encoding": {
"x": {
"axis": false,
"field": "date",
"type": "temporal"
},
"y": {
"axis": { "title": null, "labelFontSize": 8 },
"field": "price",
"type": "quantitative"
}
}
}
@valk
Copy link
Author

valk commented Oct 1, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment