我该如何更改X和Y轴标签的颜色?
我尝试在
我尝试将其应用于
scaleLabel
中使用fontColor
,但可能是在错误的位置上使用了它?我尝试将其应用于
scale
中,如源代码中可以找到。 我还尝试在scales
下甚至在xAxes
中使用它。var options = {
type: 'bar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: 'red',
borderWidth: 1
}]
},
options: {
scale: {
scaleLabel:{
fontColor: 'red'
}
},
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
};
我一直在查看文档,但对我来说并不是很清晰。
由于chart.js没有提供足够的示例,有时很难找到东西...
ticks
内部进行更改。 - Sahil