如何将 yAxis 上的 scaleLabel 显示顺时针旋转 90 度?不是刻度或标签,而是通常位于 yAxis 左侧的单个元素。在此示例中,包含字符串:labelString:'My Label'
var options = {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [
{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
borderWidth: 1
},
{
label: '# of Points',
data: [7, 11, 5, 8, 3, 7],
borderWidth: 1
}
]
},
options: {
scales: {
yAxes: [{
scaleLabel:{
display:true,
labelString:'My Label'
},
ticks: {
reverse: false
}
}]
}
}
}
var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
我的 jsfiddle:https ://jsfiddle.net/aq57fxjp/