vaheqelyan / svelte-grid

A responsive, draggable and resizable grid layout, for Svelte.
https://svelte-grid.now.sh/
MIT License
948 stars 57 forks source link

Using Chart JS inside the grid layout, #109

Closed SekSion closed 2 years ago

SekSion commented 2 years ago

Hey, i was trying to use this to render chart-js dynamicly and everything is great except that im having an issue that on load the draggable container doesnt fit on the chart, here is the photo.

Is there something im missing here?

image

vaheqelyan commented 2 years ago

Can you share your code using http://svelte.dev/repl please ? It will help me to understand the issue

SekSion commented 2 years ago

Sure @vaheqelyan, here it is https://svelte.dev/repl/0b647a52641c4fdf9855f4dcfe7f3a06?version=3.44.2

SekSion commented 2 years ago

it seems like the calculations of the wrapper for the draggable element are done before the renderization of the charts, or at least it doenst "refresh" the size of it but its just a guess, can't seem to make a solution to this yet

vaheqelyan commented 2 years ago

have a look at this https://svelte.dev/repl/59119f8d9f934f70b6e2a2d04b599aba?version=3.44.2 Removed <div class=demo-widget> on line 109, or you can set the height to 100% for the div element

SekSion commented 2 years ago

then i guess it was my brain that wasnt working correctly to not have seen this cause im sure i tried to set the div to 100% and didint work <.< sorry for your time then mate, thx