question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I am using datalabels on my bubble chart, but sometimes the bubbles and datalabels collide. Is there any solution to fix collision or detect when they are overlapping?

I can see that in the path chart > $datalabels > labels > [1] > [..n] > Label > _hitbox > _rect I have this

cx: 434.368
cy: 74.09599999999998
x0: 388.0193671875
x1: 481.7166328125
y0: 58.69599999999998
y1: 90.49599999999998

Should I check if there’s something overlapping there?

update

I can see a problem with this approach as the _rect isn’t updated until there has been a mouse over.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
EmilMoecommented, May 13, 2022

I’m having the same issue and while I find generic or D3 solutions (here for example), they are difficult to implement for Chart.js as the algorithms aren’t simple.

I’m using a bubble chart and it’s becoming an increasingly worse issue while the amount of our data is getting bigger. Do we still have any kind of solution for this?

image

I switched to apex charts as they are more modern, maybe it’s fixed the

2reactions
simonbrunelcommented, Nov 14, 2018

I have been looking and seems to be nearly no public API then I can access?

No because the plugin is still in beta and I don’t want to commit on implementation details. I’m currently rewriting the whole layouting part and moved the _hitbox outside the label so your previous implementation will break at the next release.

Anyway, I’m currently looking to introduce a new option to prevent labels to overlap and I’m wondering what is your expected behavior when 2 labels overlap?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collision | "North America's fastest growing tech conference"
"North America's fastest-growing tech conference”, Collision brings together Fortune 500 companies, groundbreaking startups and world-class speakers in ...
Read more >
Collision Definition & Meaning - Merriam-Webster
collision implies the coming together of two or more things with such force that both or all are damaged or their progress is...
Read more >
Collision - Wikipedia
In physics, a collision is any event in which two or more bodies exert forces on each other in a relatively short time....
Read more >
Collision (2022) - IMDb
Collision : Directed by Fabien Martorell. With Langley Kirkwood, Tessa Jubber, Bonko Khoza, Vuyo Dabula. Freedom always comes at a price.
Read more >
Collision | Official Trailer | Netflix - YouTube
One night in Johannesburg and their lives changed forever. # Collision premieres 16 June 2022, only on NetflixSubscribe: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found