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

Radar Charts - don't always display a fixed 5 grid lines #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lswest
Copy link

@lswest lswest commented Dec 17, 2024

I recently used your library to create a radar chart, where each max value for the indicators was 6. Since round_count was set to a fixed 5 value, it resulted in each point being somewhat off from the line, even though I was only using values 0-6.

So I instead tried my hand at changing the calculations, so that (based on the maximum "max value" of all indicators), I try to find the maximum number of grid lines between 2 and 10, that are evenly divisible by the max I calculated.

So in my case, I would get 6 lines (6 is maximally evenly divisible by 6). If you had something like 1500, it would end up being 10, and so on. I left 5 as the fallback in case the calculation fails.

I did consider making it configurable, so if that's preferable, then I can try my hand at that.

If you don't see a benefit to this change, then that's fine too.

Any suggestions or requests are welcome!

lswest and others added 2 commits December 17, 2024 11:19
Instead, use maximum theoretical value, or 5 (as fallback)
Fixes change of grids after new round_count calculation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant