ng2-charts - Can't bind to 'datasets' since it isn't a known property of 'base-chart'

前端 未结 1 1733
闹比i
闹比i 2021-01-17 22:32

Versions: Cordova: 6.3.1, Gulp CLI: 1.2.2, Ionic framework: 2.0.0-rc.0, Ionic CLI Version: 2.1.0


I\'m using ng2-charts in my ionic2 application.

相关标签:
1条回答
  • 2021-01-17 23:35

    I've never used this library, but from just looking at the latest (1.4.1) version's source code, it should be used as an attribute on a canvas @Directive({selector: 'canvas[baseChart]'})

    <canvas baseChart
       class="chart"
       [data]="datasets"
       [labels]="labels"
       [options]="options"
       [chartType]="'doughnut'">
    </canvas>
    
    0 讨论(0)
提交回复
热议问题