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
Tooltip values are not being updated when dragging fast #77
Comments
Hey @YahavTheKing123 not so sure what you mean, this is what's happening when I drag a datapoint (fast) from the given example The tooltip is always updating, there's a delay in the tooltip position animation that I don't have any control over though. Is this delay the issue you're describing? Or is something different happening on your end? If so, a video/GIF as well as some more details (e.g. browser used) etc. would be helpful. Best |
Thank you for your reply @chrispahm , I am not talking about the animation delay. My issue is with the tooltip values that are not being changed (sometimes). My browser is chrome latest version but its also happens on edge and on chrome 90V |
Hi, have you manage to identify this issue? Thanks :) |
@chrispahm One strage thing here, when the chrome devTools is open, this is not happening... not sure why |
Hey @YahavTheKing123, |
Hi @chrispahm and thank you for your check. Thanks :) |
Hey @YahavTheKing123, It's indeed really strange that the updates seem to work perfectly fine once the developer console is open, which makes it especially hard to debug. In a similar manner, I noticed that the following GANTT-Chart expressed super slow dragging behaviour, which is however fixed as well once the developer console is opened (and the page reloaded with an open dev console) https://chrispahm.github.io/chartjs-plugin-dragdata/ganttChart.html Not sure if that's a (temporary) option for you, but the issues doesn't seem to appear using Chart.js v2 (see v2 branch https://github.com/chrispahm/chartjs-plugin-dragdata/tree/v2) |
Thank for that @chrispahm. Unfortunately I need the Chartjs v3... One thing that i did found is that on FireFox, when devTools is opened, this bug is still reproduceable so maybe it will help when debugging.. Thanks :) |
Thanks to Chart.js maintainer @kurkle we finally have a fix 🎉 ( Please let me know if the new version also fixes your issue! |
@chrispahm Thank you so much :) |
What's the error you are receiving? |
After one more look, I think that it can happen due to your new syntax that is not recognize by my webpack (the js conditional chaining). can you please compile it with old syntax or with some plugin that converts it to old syntax? Thanks U @chrispahm |
I see, I checked caniuse before implementing optional chaining, and figured ~90% availability would be enough. Let me publish a quick fix, it's not used anywhere else so I guess an additional line wouldn't hurt! Here's a small blogpost on optional chaining, it has a link to the required toolchain: https://chrispahm.github.io/posts/es2020-features.html (for future projects of yours) |
Published |
Thank you for the quick response!
Can you please commit the change here to gihub and also see that the example here work with this version. Thanks @chrispahm |
Hmm that is strange, did you disable your browsers cache? |
Yep :( |
@chrispahm I think you should still cancel the replayed (or any) event when dragging. Its going to be the event before drag (because the d3-drag prevents the consumed events, such that chart.js does not receive them), so the event coordinates are at the starting point. This could cause the tooltip (and hover) to change in the |
@chrispahm Still working on some example but meanwhile I notice that in your example there is some bug (minor one). |
Hi @chrispahm :), I created this codeSandbox below. This is more or less my prod setup (except for the zoom plugin which i am using and didnt include here). You can see that here with the latest version its also not working well... Thanks in advance my friend. |
Sorry for bugging you @chrispahm , but maybe you had a chance to take a look on that? Thanks :) |
Sorry, I'm really busy with work this week. Will let you know when I get to it! |
Hey @YahavTheKing123, sorry it took me so long, the bug turned out be really difficult to fix: If we cancel all events during the dragging gesture in the
The PR chartjs/Chart.js#9992 fixing this issue has been merged a few days ago. As the fix is not released yet, I re-build Chart.js from source (attached to this comment), used it in your CodeSandbox example, and voilà: it works!
Despite the above fix, this issue hasn't been fixed yet. The |
@chrispahm FYI, you can use https://chartjs.org/dist/master/chart.js (or .min.js etc) in pens etc (not in production!), to test out the master version. edit: another fiddle with chart.js master and doing chart.tooltip.update() instead. |
@kurkle that's awesome! I didn't know about the @YahavTheKing123 here's the updated CodeSandbox using @kurkle's proposed fix: |
Published |
@chrispahm you are AMAZING!!!!! Thank you so much for your help (@kurkle to you too!) I have just tested it with the new version and finally, it works great!!! It was worth waiting :) Again thanks! This issue can be closed now :) |
Sorry for all the bugging @chrispahm and @kurkle :(, Your plugin is working now great. I see some weird behavior after you deployed your new version. I updated the codesandbox https://codesandbox.io/s/ancient-frog-chloh?file=/src/App.j (hope its ok.. I though that when I am editing it, its automatically creates new instance of it..) and you can see the behavior there. Can you please suggest how can I address this? Thanks a lot for your assistance Chris! Edit: Looks like this ugly hack is solving it for now...
|
You can use |
@kurkle , it worked like a magic!!!! Thank you! |
Hi,
When dragging points fast or in some other times, tooltip is not being updated (in Line chart).
This is happenning also in your examples here:
https://chrispahm.github.io/chartjs-plugin-dragdata/
Can you please suggest?
Thanks in advanced!
The text was updated successfully, but these errors were encountered: