We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Charts are never destroyed and leads to a memory leak.
I will submit a pull request to handle this properly, see https://vuejs.org/v2/cookbook/avoiding-memory-leaks.html#Resolving-the-Memory-Leak
Until then, this is a work around (simplified example in a component):
<template> <GChart v-if="data.length" type='PieChart' :data='data' :options='options' @ready="onChartReady" /> </template> <script> export default { data () { return { chart: null, data: [], options: {} } }, beforeDestroy () { if (this.chart) { this.chart.clearChart() } }, methods: { onChartReady (chart, google) { this.chart = chart } } } </script>
The important part are adding @ready="onChartReady" to the GChart element and storing a reference to the chart.
@ready="onChartReady"
Then adding the beforeDestroy method and using googles clearChart() method.
In the pull request I will add this to the vue-google-chart directly as this is where it should be taken care of.
The text was updated successfully, but these errors were encountered:
thanks, updated: vue-google-charts@0.3.2
Sorry, something went wrong.
No branches or pull requests
Charts are never destroyed and leads to a memory leak.
I will submit a pull request to handle this properly, see https://vuejs.org/v2/cookbook/avoiding-memory-leaks.html#Resolving-the-Memory-Leak
Until then, this is a work around (simplified example in a component):
The important part are adding
@ready="onChartReady"
to the GChart element and storing a reference to the chart.Then adding the beforeDestroy method and using googles clearChart() method.
In the pull request I will add this to the vue-google-chart directly as this is where it should be taken care of.
The text was updated successfully, but these errors were encountered: