svelte-chartjs
svelte-chartjs copied to clipboard
[Bug]: Chart does not render*
Would you like to work on a fix?
- [x] Check this if you would like to implement a PR, we are more than happy to help you go through the process.
Current and expected behavior
*I understand that you said "if you are experiencing an issue with charts rendering, please create a related issue in Chart.js repository." However, this code is a direct port from your scatter example but it only works in code-sandbox and not in a local sveltekit repo.
I would expect svelte-chartjs to work in a sveltekit app but I have been unable to discover a working example that uses sveltekit nor have I been able to get mine to work with sveltekit.
Reproduction
https://github.com/taylorjdawson/svelte-chartjs-example
chart.js version
4.3.0
svelte-chartjs version
3.1.2
Possible solution
Sveltekit uses ssr so that could potentially be causing issues. I am unsure if this library accounts for ssr?
Same issue for me
For SSR you could check out:
https://github.com/Rich-Harris/pancake or: https://layercake.graphics/
And try turning off SSR for the chart route.
Did anyone find a fix for this? Been unable to even render a line chart within svelte.
Running into the same issue with SvelteKit and svelte-chartjs
same here with sveltekit :/
chartjs does work fine on sveltekit without this library, I using it.
Is this still a problem for anyone? I'm able to use all the charts in my SvelteKit project.
Is this still a problem for anyone? I'm able to use all the charts in my SvelteKit project.
Yes :( , even with SSR turned off, charts don't render. Any solution?
Could you provide a CodeSandbox or StackBlitz with your current setup?
I can't make this work either, it just doesn't work, I can't even get the examples working.I am using sveltekit too if that matters. The chart renders in the DOM, but isn't filled in, no errors in the console or on the browser
Similarly, I can't get even the examples working by directly copy and pasting. Edit: OK, I've solved the issue. For anyone else encountering the same issue, try adding a continer to the chart with a width and height.
work fine on sveltekit without this library, I using it.
Could you share some working code example?