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

Avoid tick labels overlapping #241

Open
andreapicaro opened this issue Jun 9, 2021 · 3 comments
Open

Avoid tick labels overlapping #241

andreapicaro opened this issue Jun 9, 2021 · 3 comments

Comments

@andreapicaro
Copy link

Hello,
when setting major ticks dynamically it may happen that labels overlaps. Is there any option or strategy to avoid this overlapping?
Thanks

@jasekiw
Copy link

jasekiw commented Jul 29, 2022

I've also ran into this issue, did you find a solution?

@TuShen121
Copy link

TuShen121 commented Jul 29, 2022 via email

@jasekiw
Copy link

jasekiw commented Jul 29, 2022

@andreapicaro

I was able to fix the labels overlapping by using the events that the library emits. I had to copy over a several methods from the library to modify the drawRadialNumbers method. Note I only implemented as much as I needed for my use case which was labels at the top of the gauge. (this does not handle labels overlapping vertically). I wouldn't consider this code a candidate for a PR since there are definitely additional cases to handle.

You can see the code here:

https://gist.github.com/jasekiw/d7fbe6d8637404355301901a1eee6e8d

example usage:

const gauge = new RadialGauge(gaugeOptions);
applyRadialNumbersOverride(gauge); // from the window object after linking in the script
gauge.draw();

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

No branches or pull requests

3 participants