我正在使用以下数据集,
this.chart = new Chart(
this.canvasContext,
{
type: 'bar',
data: {
labels: ["Africa", "Asia", "Europe", "Latin America", "North America"],
datasets: [
{
label: "Population (millions)",
backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"],
data: [2478,5267,734,784,433]
}
]
},
options: {
showScale: true,
maintainAspectRatio: false,
responsive: true,
utoutPercentage: 50,
animation: {
animateRotate: true,
duration: 2000,
animateScale: true
}
}
}
)
出现所有列。
但是如果我使用data: [600,400,400,900,1100]
,则图表上不会出现400个值。它们显示为零。为什么?