谁知道如何在ionic 2中放下馅饼的标题
who know how to put down the title of pie in ionic 2
我要贴在标签下pie.who知道请告诉me.thank大家!这里的代码。
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'
}
}
完整的代码会像这样...
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'
}
}
});
我要贴在标签下pie.who知道请告诉me.thank大家!这里的代码。
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'
}
}
完整的代码会像这样...
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'
}
}
});