svelte-gantt icon indicating copy to clipboard operation
svelte-gantt copied to clipboard

Reset or Clear GanttChart

Open dyuhob opened this issue 8 months ago • 2 comments

if chart get wrong timeformat in from, to , tasks, chart explode. after that, even though I have pushed correct data into options and executed chart. it didn't work properly.

reloading page is only way to reset chart.

I'm using vue. so I want to reset chart when components were destroyed. Is there any way to reset or clear chart without reloading or closing page?

dyuhob avatar Dec 13 '23 04:12 dyuhob

Well in vue you can force a rerender of a component like this

<template>
  <MyComponent :key="componentKey" />
</template>
<script>
...
    data() {
        return {
            componentKey: 0,
        }
    },
    methods: {
        rerender() {
            this.componentKey++;
        },
    }
...
</script>

ANovokmet avatar Jan 18 '24 10:01 ANovokmet

but ganttChart does not used as components in vue. although I did re-render wrapper div, chart was not fixed. i hope there are methods to reset chart or ways to re-import index.js

dyuhob avatar Jan 24 '24 01:01 dyuhob