官方的demo里没有这类的配置,我是在看github的 issue 看到的一个类似的问题 https://github.com/chartjs/Chart.js/issues/4245
options: {
title: { //标题
display: true,
text: '访问统计',
fontColor: "#f00",
},
legend: { //图例
display: true,
color: tick_color,
labels: {
fontColor: "#f00",
}
},
scales: {
xAxes: [{
gridLines: { //网格
color: "#f00",
},
ticks: { //刻度
fontColor: "#f00",
}
}],
}
}
具体请看文档: https://github.com/chartjs/Chart.js/blob/master/docs/axes/styling.md