-
Notifications
You must be signed in to change notification settings - Fork 6
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
chart display freaks out when using collection.find().observeChanges to update chart #3
Comments
I am using observerChanges because that is the only way I could figure out to update the chart reactively. If there is a better way, that doesn't also redraw the chart, that would be great. |
In your code, var lastChart;
function showAgeGroups() {
var data = [...];
// ...
if (lastChart) {
lastChart.destroy();
}
lastChart = new Chart(ctx);
lastChart.Pie(data);
} I hope that fixes it for you! At least the jumpiness should go away. |
Thanks for the suggestion! It fixed the jitter! |
OK great. Glad I could help :). |
@ecofriend: would this be a reason to provide an actual Meteor wrapper for Chart.js, vs. just using it from npm? |
@dandv sorry, I can't answer that question with any confidence. |
Here is a link to the partial, relevant code: http://jsbin.com/dutiqadovu/edit?html,js,output
If I use the Questions.find().observeChanges method, the chart becomes jumpy when I hover over the segments. If I leave this method out, then the chart behaves normally.
Please let me know if I need to provide additional information.
The text was updated successfully, but these errors were encountered: