Is there a way to conditionally hide gridlines based on the dataset?

@javalen in the scaleOptions.ticks.callback property, you can return NaN to hide the grid line.
Thanks for the information, will that remove a single horizontal line or all horizontal lines on the chart?. I'm trying to selectively remove or hide some lines while showing others at the same time. Thanks again
You can remove individual lines. I also made a mistake in my previous comment. You return undefined not NaN.
options: : {
scales: {
yAxes: [{
ticks: {
callback: function(tick, index, ticksArray) {
// return the string representation of the tick value. Return undefined to hide the grid line
}
}
}]
}
}
Works perfectly, Thanks!
Awesome 馃槃
Most helpful comment
You can remove individual lines. I also made a mistake in my previous comment. You return
undefinednotNaN.