Skip to content
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

[Bug]: Chart does not render* #108

Open
1 task done
taylorjdawson opened this issue May 1, 2023 · 12 comments
Open
1 task done

[Bug]: Chart does not render* #108

taylorjdawson opened this issue May 1, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@taylorjdawson
Copy link

taylorjdawson commented May 1, 2023

Would you like to work on a fix?

  • 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?

@taylorjdawson taylorjdawson added the bug Something isn't working label May 1, 2023
@Lau-r-a
Copy link

Lau-r-a commented May 13, 2023

Same issue for me

@valle-xyz
Copy link

valle-xyz commented May 20, 2023

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.

@harbour0
Copy link

Did anyone find a fix for this? Been unable to even render a line chart within svelte.

@Sheco
Copy link

Sheco commented Jun 7, 2023

Running into the same issue with SvelteKit and svelte-chartjs

@faulander
Copy link

same here with sveltekit :/

@elhananjair
Copy link

chartjs does work fine on sveltekit without this library, I using it.

@dysfunc
Copy link
Contributor

dysfunc commented Feb 2, 2024

Is this still a problem for anyone? I'm able to use all the charts in my SvelteKit project.

@jevb-wsm
Copy link

jevb-wsm commented Feb 6, 2024

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?

@dysfunc
Copy link
Contributor

dysfunc commented Feb 6, 2024

Could you provide a CodeSandbox or StackBlitz with your current setup?

@EdwardLucas2
Copy link

EdwardLucas2 commented Mar 26, 2024

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

@Guandor
Copy link

Guandor commented Jun 9, 2024

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.

@tzezar
Copy link

tzezar commented Sep 5, 2024

work fine on sveltekit without this library, I using it.

Could you share some working code example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests