答案 0 :(得分:0)
您可以通过设置标签/图例的位置来实现此目的。
options: {
legend: {
position: 'bottom'
}
}
完整的代码就像这样......
this.pieChart = new Chart(this.pieCanvas.nativeElement, {
type: 'pie',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
"#ff0000",
"#0000ff",
"#ffff00",
"#008000",
"#800080",
"#ffa500"
]
}]
},
options: {
legend: {
position: 'bottom'
}
}
});