0
我想知道是否有任何選項可以在圖表js 2.6中設置,以便Y軸線從右到左以負值顯示在條形圖中。圖表js 2中如何從右側開始Y軸線爲負值?
目前,這是它的顯示方式爲負值(#2圖表小提琴): https://jsfiddle.net/j6nqt4oo/1/
代碼以供參考:
var ctx = document.getElementById("myChart2").getContext('2d');
var myChart = new Chart(ctx, {
type: 'horizontalBar',
data: {
labels: ['A', 'B'],
datasets: [{
data: [-10, -20]
}]
},
options: {
responsive: false,
showDatapoints: true,
scales: {
maintainAspectRatio: true,
responsive: false,
xAxes: [{
ticks: {
beginAtZero: true
},
gridLines: {
display: false
}
}],
yAxes: [{
gridLines: {
display: false
}
}]
},
legend: {
display: false
}
}
但是,這是我多麼希望:(Y軸在0網格線和A和B是在右邊)