Created
September 1, 2024 16:01
-
-
Save PBI-DataVizzle/fe48e2cf3fe96e09264528797a85efd2 to your computer and use it in GitHub Desktop.
alt_bar_stacked
This file contains hidden or 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
{ | |
"data": {"url": "data/cars.json"}, | |
"transform": [ | |
{"bin": {"maxbins": 50}, "field": "Horsepower", "as": "Horsepower"}, | |
{"window": [{"op": "count", "as": "index"}], "groupby": ["Horsepower"]} | |
], | |
"mark": { | |
"type": "rect", | |
"tooltip": true, | |
"strokeWidth": 0.3, | |
"stroke": "white" | |
}, | |
"encoding": { | |
"x": {"field": "Horsepower", "type": "quantitative", "bin": "binned"}, | |
"x2": {"field": "Horsepower_end"}, | |
"y": { | |
"field": "index", | |
"type": "ordinal", | |
"scale": {"reverse": true}, | |
"title": "count" | |
} | |
}, | |
"width": 400, | |
"height": 300 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment