更新后 NG2-Charts 错误无法将数据集绑定到 Angular2 中的基本图表
NG2-Charts Error Can't Bind Datasets To Base-Charts In Angular2 After Update
更新 OSX 到 Sierra 和 angular-cli 后,我的 Angular 2 应用程序坏了。我现在收到关于 ng2-charts
的错误
我曾尝试恢复,甚至尝试进一步回滚到其他版本的 Node、NPM 和 Angular-cli,但没有任何方法可以清除错误并允许应用程序呈现。
这些是我遇到的错误,引用了我尝试将数据集绑定到基本图表的每一行。
绑定
<base-chart class="chart"
[datasets]="lineChart1Data" [labels]="lineChart1Labels" [options]="lineChart1Options" [colors]="lineChart1Colours" [legend]="lineChart1Legend" [chartType]="lineChart1Type" (chartHover)="chartHovered($event)" (chartClick)="chartClicked($event)"
style="height:70px;"></base-chart>
错误
zone.js:344Unhandled Promise rejection: Template parse errors:
Can't bind to 'datasets' since it isn't a known property of 'base-chart'.
1. If 'base-chart' is an Angular component and it has 'datasets' input, then verify that it is part of this module.
2. If 'base-chart' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
("iv>
<div class="chart-wrapper p-x-1">
<base-chart class="chart" [ERROR ->][datasets]="lineChart1Data" [labels]="lineChart1Labels" [options]="lineChart1Options" [colors]="lineC"): DashboardComponent@19:46
我已经在这个应用程序上工作了几个星期,没有任何问题,现在这让我一整天都感到沮丧,有什么想法吗?
1.4.0 中有重大变化,您需要使用 <canvas baseChart...></canvas>
而不是 <base-chart...></base-chart>
。
BREAKING CHANGES
charts: - base-chart component became baseChart directive so you need
to convert
<base-chart...></base-chart>
to
<canvas baseChart...></canvas>
and most probably wrap in
<div style='display:block'>...</div>
更新 OSX 到 Sierra 和 angular-cli 后,我的 Angular 2 应用程序坏了。我现在收到关于 ng2-charts
我曾尝试恢复,甚至尝试进一步回滚到其他版本的 Node、NPM 和 Angular-cli,但没有任何方法可以清除错误并允许应用程序呈现。
这些是我遇到的错误,引用了我尝试将数据集绑定到基本图表的每一行。
绑定
<base-chart class="chart"
[datasets]="lineChart1Data" [labels]="lineChart1Labels" [options]="lineChart1Options" [colors]="lineChart1Colours" [legend]="lineChart1Legend" [chartType]="lineChart1Type" (chartHover)="chartHovered($event)" (chartClick)="chartClicked($event)"
style="height:70px;"></base-chart>
错误
zone.js:344Unhandled Promise rejection: Template parse errors:
Can't bind to 'datasets' since it isn't a known property of 'base-chart'.
1. If 'base-chart' is an Angular component and it has 'datasets' input, then verify that it is part of this module.
2. If 'base-chart' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
("iv>
<div class="chart-wrapper p-x-1">
<base-chart class="chart" [ERROR ->][datasets]="lineChart1Data" [labels]="lineChart1Labels" [options]="lineChart1Options" [colors]="lineC"): DashboardComponent@19:46
我已经在这个应用程序上工作了几个星期,没有任何问题,现在这让我一整天都感到沮丧,有什么想法吗?
1.4.0 中有重大变化,您需要使用 <canvas baseChart...></canvas>
而不是 <base-chart...></base-chart>
。
BREAKING CHANGES
charts: - base-chart component became baseChart directive so you need to convert
<base-chart...></base-chart>
to
<canvas baseChart...></canvas>
and most probably wrap in
<div style='display:block'>...</div>