請看看這個fiddle手柄X軸標籤位置圖JS
如果調整輸出窗口,你會發現,x軸的標籤變得傾斜。這對我來說很好。但是如果你注意到標籤的結束位置是酒吧的中心。我希望標籤的結束位置是酒吧的右側。如何實現這一目標?
我的配置是
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["2 Jan", "9 Jan", "16 Jan", "23 Jan", "30 Jan", "6 Feb", "13 Feb"],
datasets: [{
data: [6, 87, 56, 15, 88, 60, 12],
}]
},
options: {
legend: {
"display": false
},
tooltips: {
"enabled": false
},
scales: {
yAxes: [{
display: false,
gridLines: {
display : false
},
ticks: {
display: false,
beginAtZero:true
}
}],
xAxes: [{
gridLines: {
display : false
},
ticks: {
beginAtZero:true
}
}]
}
}
});
這個解決方案不僅僅是真棒。謝謝,非常感謝... – Kenny