-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
symfony/ux-chartjs impossible to use adapters #1013
Comments
Hi there! This "should" just work - so we will need to dig into the problem a bit. Both
So there could be 2 things going wrong: A) Ordering: if B) Or, perhaps the 2 libraries are, in the end, importing different files from the Btw, where are you importing |
Thank you for answering and for your time. I'm not 100% sure if I understand correctly how I tried importing chartjs-adapter-date-fns at different places, and at the very beginning of I have the same result every time and I don't have any other idea to go further for the moment. |
Hmm, really? You see a |
Yes it's what I have. I use npm. (Node v18.16.1 and npm v9.8.0) It is on a Symfony 6.2.12 project. |
Ok, I dug into this. The problem is npm-only, but it's not really npm's fault. Try running:
I bet you'll see 2 root "sections" in this output, each with a slightly different version of chart.js. The problem is that symfony/ux-chart.js currently allows Anyway, it's very likely that in your Try changing your version constraint for We need to add 3.9+4 support for chart.js in symfony/ux-chart.js. But also, I can tweak the version constraint so that users get |
Oh nice it worked! So I just added Then I installed date-fns : imported it in my app.js file : And now I can use scales type time perfectly 👍 Thank you a lot for your help, I'll try to notice the people on Stackoverflow who had the same problem recently. |
Hello,
I've seen a few posts about this on stackoverflow, but no answer exists yet, so I wanted to know if it is possible to implement an adapter (example date-fns) to Symfony Ux's implementation of chart.js.
I tried for a long time but I can't find a solution.
Symfony seems to be using '@symfony/ux-chartjs' while the adapters are modifying 'chart.js' directly, from what I understand.
I didn't find a way to pass this problem, so if anybody can help me about this, it would be very appreciated.
May be if anyone can bring an example of working code for this.
Thank you for your time.
The text was updated successfully, but these errors were encountered: