-
Notifications
You must be signed in to change notification settings - Fork 87
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
Sync is not working #95
Comments
Ayo, Download the unminified file, and change where new event is defined to this: |
Hit the same issue. It appears that sync is working on chartjs version 3.4.x but not newer versions. I was able to pin chartjs to |
this worked for me. very nice |
@Bodrosh I am also facing the same issue. Can you please upload an example on codesandbox with react-chartjs ? |
@geriatricdan Thank you so much :) I was stuck with this and you saved my time. Any idea why reset zoom button was placed below instead of on top of the graph ? |
@geriatricdan possibly PR so they can put this fix in the official plugin 👀 |
@erkanisuf Does zoom works ? graph not showing up after zoom. it goes away |
I am not using the zoom but yes its feels wierd and buggy |
I have done a range of fixes and improvements to the chartjs-plugin-crosshair.js file. |
@savejeff It looks zoom doesn't work with above attached file. |
what kind of zoom are you talking about? If you are talking about the zoom where you click and drag sideways to zoom into the area draged over, this works perfectly find with the code in the zip file. i use it daily. check this: i would start looking for the fault in you code. |
No errors on console. but when i zoom, line chart vanished. After reset zoom click, i can see the line chart. I am using latest version of charts.js react-chart-2.js |
dont know about react. |
I find finally the solution: I deleted the |
@cmark1302 sorry, did you manage to find a working solution for |
It seems that the fix by @geriatricdan is already contained in the repository code, but at the wrong place:
|
Im also struggling with this. Only managed to get the synced tooltips working with chartjs 3.5.1. |
I have the same problem. sync is not working in Chart.js version 4. It is working up to version 3.5.1, but not after |
I also have this problem, can confirm that it works with chart.js 3.5.1 but not greater version. Any help would be great , thanks in advanced! Update: |
Can you explain more? Please. |
Hi, you have to compile version 4.0.1 by yourself, because there are no precompiled releases.
|
Thank you for getting back. I just did what you said, but it still doesn’t work for me. It’s telling something about “interpolate “ not being apart of some object type. |
Same issues with sync and zoom here. |
I use the fork (patched) version compatible with chartjs 4. It works except that : |
switching to 3.4.1 made it work |
Just a note that the proposed fix by @geriatricdan and/or using the 4.0.1 branch as indicated above only works when the charts are the same height. If one chart is taller than another, the sync seems to work at first but can break while going back and forth across the data points so that the 2nd chart just stops moving in sync until you mouse out and back in to reset it. The first and only repo I've seen that contains a fix for variable height charts is https://github.com/TrevorLeeman/chartjs-plugin-crosshair/. The fix works great for the newest chartjs (4.4.7 at the time of writing) although it requires that you add an additional line to the chart config like this:
A big thank you to TrevorLeeman's and everyone else who originally helped with different variations on a fix for this bug! For anyone looking for a quick way to take advantage of the fixed version in your own projects, I forked TrevorLeeman's repo and added the fixed js files to the project so that they can be used via cdn. Feel free to directly link to my repo via cdn link with https://cdn.jsdelivr.net/gh/joeuhren/[email protected]/build/chartjs-plugin-crosshair.min.js. Don't forget to add the plugins > crosshair > sync > axis config line if you are going to be using variable chart heights. Also note that I do not plan to maintain my fork of the crosshair plugin. If it happens to break again in a future chartjs version, I would recommend staying with whatever version of chartjs continues to work until another fix is found. |
I am using chartjs version 3.7 , plugin version 1.2.0 and react-chartjs version 4.0.0 . The sync is not workinng for some reason .
Import and registration :
options setup:
I used two identical charts with exacly same props/data. But the sync is gone. When i have used the plugin with chartjs before version 3v and plugin version 1.1.2 , the sync has worked. Am i missing something or is this some kind of bug?
The text was updated successfully, but these errors were encountered: