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]: Can't make the chart responsive #165

Open
1 task
Bobetti opened this issue Jul 19, 2024 · 3 comments
Open
1 task

[Bug]: Can't make the chart responsive #165

Bobetti opened this issue Jul 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Bobetti
Copy link

Bobetti commented Jul 19, 2024

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

Take the bar chart official sandbox.
Resize window horizontally. Chart resizes to the smaller size without problem, but never resizes back when window becomes larger.

In my Svelte project, see the code below, I'm using tailwind:

<div class="chart-container w-full">
	<Bar {data} options={{ responsive: true }} class="chart" id={Id} />
</div>

On window resize - huge flickering, but chart remains small.

Registering on window resize event and changing canvas element width - has no effect.

Can't make the chart responsive

Reproduction

https://codesandbox.io/p/devbox/github/SauravKanchan/svelte-chartjs/tree/master/sandboxes/bar?file=%2Fcomponents%2FChart.svelte%3A17%2C13

chart.js version

4.4.3

svelte-chartjs version

3.1.5

Possible solution

No response

@Bobetti Bobetti added the bug Something isn't working label Jul 19, 2024
@Bobetti
Copy link
Author

Bobetti commented Jul 19, 2024

Please delete this request, found the answer deep inside documentation. Sorry.

@DevilWarrior
Copy link

Please delete this request, found the answer deep inside documentation. Sorry.

Could you share where please? I'm having the same issue.

@Bobetti
Copy link
Author

Bobetti commented Oct 4, 2024 via email

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

2 participants