You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I recently switched Chart.js from v2.x to 3.x. I also use the chartjs-plugin-zoom 1.0.1. My situation is this I have SPA with some tabs, on one tab are the charts, between them line chart and for this one I use the zoom plugin, because data are usually huge.
When I transit from page with charts to another, this is called for cleaning:
if (this._chart) { this._chart.options.onClick = null; //desperate attempt to save situation this._chart.options.plugins = null; this._chart.clear(); this._chart.destroy(); }
I expected that destroy do everything necessary from memory perspective. For version 2 it is working, but here I observe strange behavior. When I switch from chart page to another and inspect memory I saw LineController(object asociated with chart.js) between objects. When I switch back to chart page and then again to another memory consumtion raise and count of LineController too. Raising instances
What i find out is this, when I comment the zoom plugin from options everything is working again, no more raising LineControll instances no visible memory consumption raise between pages switching. But this plugin is necessary for me, so commenting out is not good option. I tried manually set plugins for chart to null:
this._chart.options.plugins = null;
But this not solve the memory problem. Has anybody face such condition? I also posted question to with code snippets so
The text was updated successfully, but these errors were encountered:
At least I'm not aware of any polyfills. When I find moment to take a breath I try to extract minimal example to flems(but not sure, how such platform allows to inspect memory, so maybe minimal html like samples is more appropriate?).
Hello. I tried extract minimal example. So I not observe same behavior(no more LineController). On the other hand seems like everything else is same. Memory consumption raises despite destroy called and only if I use plugin zoom. It looks like this, first sample is desperate toggling between pages after loading the site. Second sample is desperate toggling between pages after first one.
If there will be interest for this behavior, I can provide minimal html for inspection.
Maybe for comparison I add the desperate toggling without zoom plugin.
Hello, I recently switched Chart.js from v2.x to 3.x. I also use the chartjs-plugin-zoom 1.0.1. My situation is this I have SPA with some tabs, on one tab are the charts, between them line chart and for this one I use the zoom plugin, because data are usually huge.
When I transit from page with charts to another, this is called for cleaning:
if (this._chart)
{
this._chart.options.onClick = null;
//desperate attempt to save situation
this._chart.options.plugins = null;
this._chart.clear();
this._chart.destroy();
}
I expected that destroy do everything necessary from memory perspective. For version 2 it is working, but here I observe strange behavior. When I switch from chart page to another and inspect memory I saw LineController(object asociated with chart.js) between objects. When I switch back to chart page and then again to another memory consumtion raise and count of LineController too. Raising instances
What i find out is this, when I comment the zoom plugin from options everything is working again, no more raising LineControll instances no visible memory consumption raise between pages switching. But this plugin is necessary for me, so commenting out is not good option. I tried manually set plugins for chart to null:
this._chart.options.plugins = null;
But this not solve the memory problem. Has anybody face such condition? I also posted question to with code snippets so
The text was updated successfully, but these errors were encountered: