我想隐藏react-chartjs-2折线图的网格线。我尝试了以下代码。但不起作用。
scales: {
xAxes: [{
gridLines: {
display: false,
drawOnChartArea: false,
drawTicks: false
},
ticks: {
display: false
}
}],
}
从xAxes和yAxes中删除ticks属性:https://codesandbox.io/s/react-typescript-cbs9u
const options: ChartOptions = {
legend: {
display: false
},
scales: {
xAxes: [
{
gridLines: {
lineWidth: 0
}
}
],
yAxes: [
{
gridLines: {
lineWidth: 0
}
}
]
}
};