Skip to content

Instantly share code, notes, and snippets.

@PBI-DataVizzle
Created January 13, 2024 10:51
Show Gist options
  • Select an option

  • Save PBI-DataVizzle/d4d4aa3c1ea4e990921be806b3dd2457 to your computer and use it in GitHub Desktop.

Select an option

Save PBI-DataVizzle/d4d4aa3c1ea4e990921be806b3dd2457 to your computer and use it in GitHub Desktop.
multiple_datasets_vl
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.2.0.json",
"config": {"view": {"continuousHeight": 300, "continuousWidth": 400}},
"hconcat": [
{
"data": {
"name": "Dataset1",
"format": {"type": "json", "property": "data.histogram"},
"url": "https://gist.githubusercontent.com/hemagso/f7b4381be43b34ece4d8aa78c936c7d5/raw/0bae0177b8a2a5d33e23c0d164d4439d248aa9ff/mock,json"
},
"encoding": {
"x": {
"bin": {"binned": true},
"field": "bin_start",
"scale": {"type": "linear"}
},
"x2": {"field": "bin_end"},
"y": {"field": "count", "type": "quantitative"}
},
"mark": "bar"
},
{
"data": {
"name": "Dataset2",
"format": {"type": "json", "property": "data.fill"},
"url": "https://gist.githubusercontent.com/hemagso/f7b4381be43b34ece4d8aa78c936c7d5/raw/0bae0177b8a2a5d33e23c0d164d4439d248aa9ff/mock,json"
},
"encoding": {
"color": {"field": "level", "type": "nominal"},
"x": {"field": "level", "type": "nominal"},
"y": {"field": "count", "type": "quantitative"}
},
"mark": "bar"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment