SjoerdTilmans / sjvisualizer

Library to make animated data visualizations from time series data
https://www.sjdataviz.com/software
MIT License
198 stars 30 forks source link

How to prevent values ​​from inverting into bars? #32

Closed agh620 closed 1 month ago

agh620 commented 1 month ago

In bar chart race that made by sjvisualizer higher values inverting into bars.

How to prevent values ​​from inverting into bars? in jupyter notebook what commands must change?

agh620 commented 1 month ago

If it possible answer me soon mr Sjoerd Tilmans

I saw some of your youtube short videos and you fix this inverting in your charts!

SjoerdTilmans commented 1 month ago

@agh620 , I am not quite sure what you mean. Could you indicate in a picture?

agh620 commented 1 month ago

@agh620 , I am not quite sure what you mean. Could you indicate in a picture?

Untitle3453453535d

see this example in this chart "0" - "25" - "191" - "216" - "492" values are normal and placed out side of bars but "23,997" and "25,655" flipped into bars!
how to prevent from values flip or inverting into bars?

https://github.com/user-attachments/assets/d9bea606-6bf1-4051-8037-5b9cd9c56cf6

SjoerdTilmans commented 1 month ago

This can't be accomplished using an argument today. But it can be hacked in the BarRace.py file. But if you do this it will be overwritten if you reinstall the package. So make sure to keep a local copy!

Here is the code snippet where it happens: image Line 482 determines if the values should be drawn inside the bar or not. If you replace that statement to something that is always false like "if True == False:" it will skip that part of the code. But this is a hacky solution.