Navigation Menu

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/af1958d3f22bd876959ebcc97105dd14 to your computer and use it in GitHub Desktop.
Save ashleydavis/af1958d3f22bd876959ebcc97105dd14 to your computer and use it in GitHub Desktop.
An example vega lite chart with two series that have two different scales. This shows a problem that the scales aren't independent.
{
"$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"
}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment