swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.3k stars 1.15k forks source link

Requires @angular/cdk/portal by default #1624

Open rustam-mukhametshin opened 3 years ago

rustam-mukhametshin commented 3 years ago

Describe the bug Cant use charts and start serving ng app with defaults.

To Reproduce

  1. Init new project with ng new newProject (11/12 angular).
  2. Do npm i @swimlane/ngx-charts --save
  3. Add BarChartModule to AppModule
  4. Add <ngx-charts-bar-vertical></ngx-charts-bar-vertical> to app.component.html
  5. Run ng serve
  6. See error that requires @angular/cdk/portal

Expected behavior Serving ng app and seeing empty html, if passed no data in results property. Without requiring @angular/cdk/portal

Screenshots image

Demo

ngx-charts version "^18.0.1"

Additional context package.json "dependencies": { "@angular/animations": "~11.2.11", "@angular/common": "~11.2.11", "@angular/compiler": "~11.2.11", "@angular/core": "~11.2.11", "@angular/forms": "~11.2.11", "@angular/platform-browser": "~11.2.11", "@angular/platform-browser-dynamic": "~11.2.11", "@angular/router": "~11.2.11", "@swimlane/ngx-charts": "^18.0.1", "rxjs": "~6.6.0", "tslib": "^2.0.0", "zone.js": "~0.11.3" },

"devDependencies": { "@angular-devkit/build-angular": "~0.1102.10", "@angular/cli": "~11.2.10", "@angular/compiler-cli": "~11.2.11", "@types/node": "^12.11.1", "typescript": "~4.1.5" }

juergenr commented 3 years ago

Same Problem. fall back: ngx-charts version 17.0.1 is working with angular 12.0.1

aharris commented 3 years ago

Same issue except for 17.0.1 doesn't work for me either.