Created
August 11, 2017 01:33
-
-
Save ashleydavis/5aea58ee98c2eec9913b309836181a5b to your computer and use it in GitHub Desktop.
Example vega-lite chart with two time series and multiple layers - the second Y axis is moved to the right hand side of the chart.
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", | |
"data": { | |
"url": "https://vega.github.io/vega-lite/data/seattle-weather.csv" | |
}, | |
"layer": [ | |
{ | |
"mark": "line", | |
"encoding": { | |
"x": { | |
"timeUnit": "month", | |
"field": "date", | |
"type": "temporal" | |
}, | |
"y": { | |
"aggregate": "mean", | |
"field": "temp_min", | |
"type": "quantitative", | |
"axis": { | |
"orient": "left" | |
} | |
} | |
} | |
}, | |
{ | |
"mark": "line", | |
"encoding": { | |
"x": { | |
"timeUnit": "month", | |
"field": "date", | |
"type": "temporal" | |
}, | |
"y": { | |
"aggregate": "mean", | |
"field": "temp_max", | |
"type": "quantitative", | |
"axis": { | |
"orient": "right" | |
} | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment