Created
August 21, 2017 05:11
-
-
Save ashleydavis/a7777573cc7a99b16dbd8c753fe70aae to your computer and use it in GitHub Desktop.
Example vega-lite chart with independent y axis'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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