amcharts / amcharts4

The most advanced amCharts charting library for JavaScript and TypeScript apps.
https://www.amcharts.com/
1.16k stars 322 forks source link

Angular 7 issues compiling #481

Closed jimmykane closed 5 years ago

jimmykane commented 6 years ago

After upgrading to AG 7 I get:

> quantified-self@1.8.4 start /Users/dimtrioskanellopoulos/Projects/track-tools
> ng serve

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

ERROR in node_modules/@amcharts/amcharts4/.internal/charts/elements/NavigationBar.d.ts(171,5): error TS2416: Property 'validateDataElement' in type 'NavigationBar' is not assignable to the same property in base type 'Component'.
  Type '(dataItem: NavigationBarDataItem) => void' is not assignable to type '(dataItem: this["_dataItem"]) => void'.
    Types of parameters 'dataItem' and 'dataItem' are incompatible.
      Type 'this["_dataItem"]' is not assignable to type 'NavigationBarDataItem'.
        Type 'DataItem' is not assignable to type 'NavigationBarDataItem'.
          Property 'name' is missing in type 'DataItem'.
node_modules/@amcharts/amcharts4/.internal/charts/types/ChordDiagram.d.ts(190,5): error TS2416: Property 'links' in type 'ChordDiagram' is not assignable to the same property in base type 'FlowDiagram'.
  Type 'ListTemplate<ChordLink>' is not assignable to type 'ListTemplate<this["_link"]>'.
    Type 'ChordLink' is not assignable to type 'this["_link"]'.
      Type 'ChordLink' is not assignable to type 'FlowDiagramLink'.
        Types of property 'copyFrom' are incompatible.
          Type '(source: ChordLink) => void' is not assignable to type '(source: this["_link"]) => void'.
            Types of parameters 'source' and 'source' are incompatible.
              Type 'this["_link"]' is not assignable to type 'ChordLink'.
                Type 'FlowDiagramLink' is not assignable to type 'ChordLink'.
                  Property 'radius' is missing in type 'FlowDiagramLink'.
node_modules/@amcharts/amcharts4/.internal/charts/types/SankeyDiagram.d.ts(162,5): error TS2416: Property 'links' in type 'SankeyDiagram' is not assignable to the same property in base type 'FlowDiagram'.
  Type 'ListTemplate<SankeyLink>' is not assignable to type 'ListTemplate<this["_link"]>'.
    Type 'SankeyLink' is not assignable to type 'this["_link"]'.
      Type 'SankeyLink' is not assignable to type 'FlowDiagramLink'.
        Types of property 'copyFrom' are incompatible.
          Type '(source: SankeyLink) => void' is not assignable to type '(source: this["_link"]) => void'.
            Types of parameters 'source' and 'source' are incompatible.
              Type 'this["_link"]' is not assignable to type 'SankeyLink'.
                Type 'FlowDiagramLink' is not assignable to type 'SankeyLink'.
                  Property 'startX' is missing in type 'FlowDiagramLink'.
jimmykane commented 6 years ago

^4.0.0-beta.63

xorspark commented 6 years ago

Are you using a TypeScript version >= 3? This stack trace looks similar to issue #420.

mic0201 commented 6 years ago

I also facing this problem, and I don't know how to do it

@xorspark
Angular 7 need TypeScript version >= 3.1.1 and < 3.2.0 when I downgrade TypeScript version from "~3.1.1" to "2.7.2" , this is the error message: "ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 2.7.2 was found instead."

xorspark commented 6 years ago

Since Angular 7 requires TypeScript 3.1.1+, this is pending on #420's completion as AmCharts 4 doesn't support TypeScript 3.x yet. I have notified the team about this ticket as well.

martynasma commented 5 years ago

Hey, just noticing this old thread. amCharts 4 now supports TS3. Closing.