-
-
Notifications
You must be signed in to change notification settings - Fork 836
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 crashes when reentering page #223
Comments
Your component looks okay. Please provide a reproduction. |
Can´t seem to be able to replicate the error. Yes i´m using vue-router. Do you think that might be the cause of error? I´ve also looked trough the issues in chart.js github. The closest i came here is this issue https://github.com/chartjs/Chart.js/issues/1377. |
Hm thats weird. I don't think that there is a problem with vue-router. It should work without problems because the chart.js instance get properly destroyed. https://github.com/apertureless/vue-chartjs/blob/develop/src/BaseCharts/Bar.js#L88 I will see if I can reproduce it. |
Well I could not reproduce it. I guess it rather an error in your code. Event.$on('updateLineChart', () => {
this._chart.update()
}) I don't know when the event get triggered. Maybe the chart is not initialized.
|
Expected Behavior
Chart renders upon loading the page, and works fine. Go to another page, and come back and the chart should render and still work fine.
Actual Behavior
When leaving the page and come back the chart component crashes with the console error
Uncaught TypeError: Cannot read property 'clearRect' of null
Chart component:
Environment
The text was updated successfully, but these errors were encountered: