Open thecashewtrader opened 2 years ago
Do you still have this issue?
I was trying to make a minimal reproduction, however ran into #33. I'll try to fix that and then check if it works.
Update: Unfortunately yes, I'm still having the issue, and I've added a minimal reproduction.
I had the same problem but found a workaround. If you only store the x
coordinate the y
coordinate get's automatically calculated when the chart is rendered. So before storing an update in the db set the y
coordinate to undefined
.
I am using hill-chart with SvelteKit on minb.
Initially the Hill Chart works fine, but when I save the x and y coordinates to the database and then refresh the page, the y coordinate seems to be capped to about half of the height.
I tried:
<svg />
element before runninghill.render()
id
(css selector, not to be confused with data point id) andtarget
for each Hill Chart as I'm rendering multiple of them per documentbut none of them worked.
I understand this issue is not fully clear, I'll hopefully add a minimal reproduction once I'm done with exams.
In the meantime, I looked into the source code and found this:
Saving only the x coordinate to the database works as expected, because the y coordinate is derived from it. I hope this workaround helps someone.
EDIT
Minimal reproduction
yarn create vite
->Svelte
->SvelteKit
->Skeleton Project
cd
into the project directory.yarn
,yarn add hill-chart
Add this code to
src/routes/+page.svelte
:Minimal Reproduction