I am using react-chartjs-2 version 5 and I want to hide the gridlines. I have tried this code snippet but did not work.
xAxes: [
{
display: false,
gridLines: {
display: false,
zeroLineColor: "transparent"
}
}
],
yAxes: [
{
display: false,
gridLines: {
display: false,
zeroLineColor: "transparent"
},
}
]
2
Answers
Tried your snippet but its not working in
react-chartjs-2
v5.2Solution: you can simply raplace
xAxes, yAxes
withx,y
and instead ofgridLines
withgrid
insidescales
I removed gridlines here: removed gridlines here
I run it on "react-chartjs-2": "^5.2.0", on React TS project:
Just add In option for your chart grid display:false