Zéfling

Crash on navigate

Recommended Posts

Hi,

I use FusionCharts with Angular, but we still have errors after 2 or 3 navigation in our own application. The creation and the destruction goes wrong after a little while.

image.png.3d5198bb35131213ed1d94cd6883b5dc.png

zone.js:199 Uncaught TypeError: Cannot read property 'paper' of undefined
    at e.getFromEnv (fusioncharts.js:13)
    at t.winMouseHover (fusioncharts.js:29)
    at fusioncharts.js:13
    at ZoneDelegate.ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Zone.ac_polyfills../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at ZoneTask.ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:498)
    at invokeTask (zone.js:1744)
    at globalZoneAwareCallback (zone.js:1770)

image.png.435f7b5ae13c785901d0035ad65fe3a2.png

zone.js:199 Uncaught TypeError: Cannot read property 'animationObj' of undefined
    at t.setAnimation (fusioncharts.js:14)
    at e.t._setRemoveAnim (fusioncharts.js:13)
    at fusioncharts.js:13
    at c (fusioncharts.js:13)
    at e.t._removeUnusedGraphics (fusioncharts.js:13)
    at e.t.syncDraw (fusioncharts.js:13)
    at e.updateVisual (fusioncharts.js:13)
    at Object.t.__drawJob [as job] (fusioncharts.js:13)
    at y (fusioncharts.js:13)
    at ZoneDelegate.ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Zone.ac_polyfills../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)
    at ZoneTask.invoke (zone.js:487)
    at timer (zone.js:2281)

image.png.854d76bc748621a95c6080083ce6f08f.png

Uncaught TypeError: Cannot set property 'data' of undefined
    at e._addChartDependency (fusioncharts.js:formatted:1)
    at e.setChartData (fusioncharts.js:formatted:1)
    at FusionChartsComponent.ac_main../node_modules/angular-fusioncharts/src/fusioncharts.component.js.FusionChartsComponent.updateChartData (fusioncharts.js:formatted:1)
    at placement-chart.component.ts:318
    at ZoneDelegate.ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Object.onInvokeTask (fusioncharts.js:formatted:1)
    at ZoneDelegate.ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
    at Zone.ac_polyfills../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)
    at ZoneTask.invoke (zone.js:487)
    at timer (zone.js:2281)
    at ____________________Elapsed_2764_ms__At__Tue_Jun_25_2019_17_58_28_GMT_0200__heure_d__t__d_Europe_centrale_ (localhost)
    at Object.onScheduleTask (fusioncharts.js:formatted:1)

 

Share this post


Link to post
Share on other sites

We found a solution :

static updateChart(component: FusionChartsComponent) {
    if (component) {
        // force update SVG URLs
        FusionCharts.options['_SVGDefinitionURLUpdated'] = false;
        // update chart
        component.updateChartData();
    }
}

 

Share this post


Link to post
Share on other sites

Sorry the good code is :

static updateChart(component: FusionChartsComponent) {
    try {
        if (component) {
            // force update SVG URLs
            FusionCharts.options['_SVGDefinitionURLUpdated'] = false;
            // update chart
            component.updateChartData();
        }
    } catch (error) { }
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now