我有多个函数可以返回数字(统计信息),我想使用这些数字并以角度显示在饼图中。
我尝试使用ng2-chart,然后将函数代入这样的数字
public pieChartData: number[] = [this.function1(),this.function2(),this.function3()];
但未显示任何内容,看起来好像没有绑定数据。
这是一个函数示例
function1() {
const myList = this.entries.filter(entry => entry.status === 'some string');
return myList.length;
}
所以我的问题是如何使用角度的动态数据绘制图表?