3

I was using FusionCharts to build some charts.Now that i know how to integrate it using npm I want to upgrade to a commercial license for my client. I didn't see any documentation specific to npm version. The documentation on official website points to Fusion charts npm installation but there is no mention of how to upgrade to licensed version.

budding_fed
  • 71
  • 1
  • 6

1 Answers1

2

Documentation is really lacking in this regard, that's a shame. After reading tons of stuff, that's what I came up, in Angular 7:

  1. Removed the npm package fusioncharts, but kept "angular-fusioncharts": "^3.0.1"

  2. Created a folder libs in the root of my project, then put inside this folder the content downloaded from the link in the purchase email, renaming to fusioncharts

  3. Changed my imports from:

    import * as FusionCharts from 'fusioncharts'
    import * as Charts from 'fusioncharts/fusioncharts.charts'
    import * as PowerCharts from 'fusioncharts/fusioncharts.powercharts'
    import * as FusionTheme from 'fusioncharts/themes/fusioncharts.theme.fusion'

to

    import * as FusionCharts from 'libs/fusioncharts/js/fusioncharts'
    import * as Charts from 'libs/fusioncharts/js/fusioncharts.charts'
    import * as PowerCharts from 'libs/fusioncharts/js/fusioncharts.powercharts'
    import FusionTheme from 'libs/fusioncharts/js/themes/fusioncharts.theme.fusion'
  1. The init code was the same:

    FusionChartsModule.fcRoot(FusionCharts, Charts, PowerCharts, FusionTheme)


I don't understand why I was getting an error if I kept the import * as FusionTheme for the theme package, I had to change to import FusionTheme from.

I put "allowSyntheticDefaultImports": true in my tsconfig.json at some point during this process, not sure if this configuration is needed for this last step.

Some (not that) useful links:

https://www.fusioncharts.com/dev/getting-started/angular/angular/configure-your-chart-using-angular

https://www.fusioncharts.com/dev/upgrading/upgrading-from-evaluation-versions

Bruno Medeiros
  • 2,251
  • 21
  • 34
  • if you are getting any issue with angular-fusioncharts ngcc failed try with angular-fusioncharts:3.0.4 – Zapdos13 Jan 14 '21 at 12:57