Closed emiola closed 5 years ago
How are you updating the bar?
I think it's simply a divide by zero issue.
See here:
<script>
import ProgressBar from "@okrad/svelte-progressbar";
export let series = [];
export let thickness = 0;
let bar;
const updateBar = values => {
values.map((v, i) => bar.updatePerc(v, i));
};
const resetBar = () => {
updateBar([0, 0]);
};
</script>
<ProgressBar bind:this={bar} {series} />
<button on:click={() => updateBar([100, 100])}>update</button>
<button on:click={resetBar}>reset</button>
resetBar()
triggers the issue.
You were right, it was a division by zero... Now it should be solved.
Updating the bar, I see an error:
Error: <stop> attribute offset: Expected number or percentage, "NaN%".
,coming from this row.