Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashleydavis/a7777573cc7a99b16dbd8c753fe70aae to your computer and use it in GitHub Desktop.
Save ashleydavis/a7777573cc7a99b16dbd8c753fe70aae to your computer and use it in GitHub Desktop.
Example vega-lite chart with independent y axis'
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"layer": [
{
"data": {
"url": "https://vega.github.io/vega-lite/data/seattle-weather.csv"
},
"mark": "line",
"encoding": {
"x": {
"field": "date",
"type": "temporal"
},
"y": {
"field": "temp_min",
"type": "quantitative",
"axis": {
"orient": "left"
}
}
}
},
{
"data": {
"url": "data/stocks.csv"
},
"transform": [
{
"filter": "datum.symbol==='GOOG'"
}
],
"mark": "line",
"encoding": {
"x": {
"field": "date",
"type": "temporal"
},
"y": {
"field": "price",
"type": "quantitative",
"axis": {
"orient": "right"
}
}
}
}
],
"resolve": {"y": {"scale": "independent"}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment