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
avoid not needed updates for the chart, when dom element changes #52
Conversation
changed updated to watch to draw the chart only when the data changes
Thanks @dirk-ecker 👍 I'm able to reproduce the issue, but the PR isn't fixing it. Here's the code I'm using to reproduce. <div id="app">
<pie-chart :data="[['Blueberry', 44], ['Strawberry', 23]]" :library="{animation: {duration: 1000}}"></pie-chart>
{{count}}
</div>
<script>
var app = new Vue({
el: "#app",
data: {
count: 0
},
mounted: function() {
setInterval(() => {
this.count += 1
}, 2000)
}
})
</script> Also, I think we'll need the same for |
Yes sure we should also implement this for the chartOptions and all other props. It is working if you do not inline the data in the pie chart:
So far I do not know the reason for this behaviour. |
Cool, happy to merge once chart options are fixed. |
okay, chart options are also fixed, have a look ;-) |
When I run it on test/index.html, I get |
Oh the automatic insertion of semicola fails at this point. |
Hey @dirk-ecker, when I run this against I also created a branch with a different solution that's working for me: https://github.com/ankane/vue-chartkick/compare/less_updates |
I've narrowed down the problem. It only happens when you pass a JavaScript object as an inline prop. If you use data for the |
The issue is described here: vuejs/vue#4060 Think a deep equal on |
Alright, think the |
Yes it works as expected. |
Awesome, merged in d3b0e42, and will push out a new release shortly. Thanks for reporting and helping solve this. |
Hi,
the actual version gives a TypeError if a chart is destroyed.
I think you have to nest your destroy one layer deeper or add a destroy on
the chart level.
Thanks in advance
Dirk
…On 30 May 2018 at 10:41, Andrew Kane ***@***.***> wrote:
Closed #52 <#52>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AhY_FvS4-a68M2xTz8_LwWoBXv-6J-9gks5t3lsdgaJpZM4UCdLq>
.
|
This should be solved in 0.3.3, as |
Okay, you are right. I was missing the update. Thank you. |
When using animation like in this example
<pie-chart :title="'Anteile an den Gesamtausgaben'" :data="openAccessBarometer.costsPublisher" thousands="." decimal="," legend="right" :suffix="openAccessBarometer.relative ? '%' : '€'" :library="{animation: {duration: 1000}}" download="true" :messages="{empty: 'Keine Daten verfügbar.'}"></pie-chart>
you will see that every change in the dom creates a repaint of the chart. This is done in the updated method of the chart. Change it to a watcher on the data and everything is fine.