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

Reset or Clear GanttChart #195

Closed
dyuhob opened this issue Dec 13, 2023 · 3 comments
Closed

Reset or Clear GanttChart #195

dyuhob opened this issue Dec 13, 2023 · 3 comments

Comments

@dyuhob
Copy link

dyuhob commented Dec 13, 2023

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?

@ANovokmet
Copy link
Owner

ANovokmet commented Jan 18, 2024

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>

@dyuhob
Copy link
Author

dyuhob commented Jan 24, 2024

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
Copy link
Author

dyuhob commented Aug 7, 2024

I have solved this problem through method to destory instance
let ganttInstance = new SvelteGantt({
target: ~
option: ~
})
ganttInstance.$destroy()

@dyuhob dyuhob closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants