3
如何使用ng2圖表設置圖表的寬度和高度?我正在製作條形圖,就像在ng2-charts網站上的演示一樣。調整ng2圖表的寬度和高度
public doughnutChartLabels:string[] = ['EMI', 'Car', 'Food', 'Fuel'];
data:number[] = [3350, 5450, 4100, 1000];
public doughnutChartType:string = 'doughnut';
options: { responsive: true, }
colorsEmptyObject: Array<Color> = [{}];
public datasets: any[] = [
{
data: this.data,
backgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
]
}];
// events
public chartClicked(e:any):void {
console.log(e);
}
public chartHovered(e:any):void {
console.log(e);
}