plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.74k stars 1.84k forks source link

Wind rose malfunctioning #5793

Open StephaneAdeso opened 3 years ago

StephaneAdeso commented 3 years ago

Not that plotly has a bug. Is that the example ( javascript section) that you have set as a wind rose does not work well. That is to say, it is not a wind rose. Below I put a comparison of how a wind rose should work, and how the one you have put in the documentation / example works. plotly error In the following video I show you the difference between Plotly wind rose ( on the left) and a wind rose that works well ( the one on the right). Please note that the data are independent of each other and are represented on top of each other. While in the compass rose of plotly, they are totaled. Also, in a normal rose, when you turn off a lower data span, the scale changes. However, when doing it in plotly, the scale does not change because the data is wrong and the functioning is wrong.

https://user-images.githubusercontent.com/55595063/124102309-86e80400-da60-11eb-8bd2-d76998bc55ea.mp4

There you have the live examples to try it yourself:

example 1 (plotly): https://plotly.com/javascript/wind-rose-charts/ example 2 (other chart): https://jscharting.com/examples/chart-types/radar-polar/wind-rose/ example 3 ( other chart): https://www.makeapie.com/editor.html?c=xa-f-aLlNA I do not doubt that this chart is very useful for some people, but of course it is not a wind rose and therefore it is totally unusable for that purpose. Can someone tell me if a wind rose can be made that works correctly using plotly? If yes, could someone change the example in the documentation to see how? I'm totally new to using plotly and have no idea how to make a wind rose.

nicolaskruchten commented 3 years ago

You're right, in our Javascript documentation this is incorrect. It's correct in the Python version of the docs, however: https://plotly.com/python/wind-rose-charts/

The key is the barmode: "overlay" attribute in the JS example (and the data prep). We'll try to rework it to function like the Python version, but in the meantime, dropping that attribute will allow your bars to stack as they do in the Python version :)