Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change radial graph orientation according to cardinal points #9079

Open
EmmanuelleKerjouan opened this issue Sep 6, 2023 · 0 comments
Open

Comments

@EmmanuelleKerjouan
Copy link

Our aim is to create a radal plot oriented according to the points of the compass. We've made a first attempt that works well. However, we wanted to know if it was possible to place the cardinal points at the right angle, and thus position the N...

Here is the json of the current graph :
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A simple radial chart with embedded data.",
"data": {
"values": [
{"category": "N", "value": 236142.1},
{"category": "NNE", "value": 198490.641},
{"category": "NE", "value": 180178.693},
{"category": "ENE", "value": 225907.263},
{"category": "E", "value": 285517.046},
{"category": "ESE", "value": 314869.103},
{"category": "SE", "value": 401478.068},
{"category": "SSE", "value": 329396.276},
{"category": "S", "value": 208707.178},
{"category": "SSW", "value": 359787.985},
{"category": "SW", "value": 153546.442},
{"category": "WSW", "value": 93985.971},
{"category": "W", "value": 51060.691},
{"category": "WNW", "value": 107711.766},
{"category": "NW", "value": 309127.719},
{"category": "NNW", "value": 449500.89}
]
},
"layer": [{
"mark": {"type": "arc", "innerRadius": 20, "stroke": "#55759a"}
},{
"mark": {"type": "text", "radiusOffset": 20},
"encoding": {
"text": {"field": "category", "type": "nominal"}
}
}],
"encoding": {
"theta":{"field":"category"},
"radius": {"field": "value", "scale": {"type": "sqrt", "zero": true, "rangeMin": 5}}, "color": {"value": "#87afe0"}

}
}

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant