-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Error message in my console by using VueJs and chartJS #4605
Comments
@simonbrunel was this fixed by #4591 ? |
@etimberg Thanks for your response. Could you tell me that this issue will fixed in the next version or how can I fixed this issue on 2.6.0? |
@simonbrunel you can change the
|
@ascrutae The problem is that you create a Chart on a canvas which is not attached to the DOM. It should be fixed now, you can verify with this development build. I don't know Vue.js but maybe a better approach would be to create the chart when the node is inserted and destroy it on remove: Vue.directive('demo', {
bind: function() {
this.config = {
type: 'line',
data: { /*...*/ },
options: { /*...*/ }
};
},
inserted: function(el) {
this.chart = new Chart(el, this.config);
},
// would do that in a `removed` hook, but doesn't seem to exist
unbind: function() {
this.chart.destroy();
this.chart = null;
}
}); |
Thanks for you suggest. it works. BTW, Is this bug will fixed in next version? and when is the next version released? |
It will be fixed in the next version, no release date decided yet. |
Though, you don't need that fix if you opt for the suggested approach and instantiate the chart in the |
@simonbrunel , you are awesome, it works, Thanks very much! |
Expected Behavior
the width and height of the chart can dynamic changed and the chart can display
Current Behavior
the chart cannot display and error message in my console:
here is the message log:
Steps to Reproduce (for bugs)
Here is my example:http://jsfiddle.net/ascrutae/0vrmtvd5/5/
Environment
The text was updated successfully, but these errors were encountered: