我正在使用NPM ng2modules-easypiechart进行离子项目
导入模块app.maodule.ts
import { EasyPieChartModule } from 'ng2modules-easypiechart';
imports: [
EasyPieChartModule
]
我在组件模板中使用了easyPieChart指令,但图表没有出现。
HTML
<easy-pie-chart [percent]="percent" [options]="options"></easy-pie-chart>
组件
import 'easy-pie-chart/dist/easypiechart.js';
@Component({
selector: 'page-transactiontype',
templateUrl: 'TransactionDetails.html'
})
export class TransactionDetails {
public percent: number;
public options: any;
constructor() {
this.percent = 80;
this.options = {
barColor: '#ef1e25',
trackColor: '#f9f9f9',
scaleColor: '#dfe0e0',
scaleLength: 5,
lineCap: 'round',
lineWidth: 3,
size: 110,
rotate: 0,
animate: {
duration: 1000,
enabled: true
}
};
}
}