react-chartjs-2
react-chartjs-2 copied to clipboard
Hide axis when dataset is turned off
I'm using 2 axes for different datasets. When the dataset is turned off 0 0.1, 0.2
is shown on the corresponding axis.
Is there any way to hide the axis or adjust its ticks when the dataset is turned off?
Hi @alex-mironov 👋
You can achieve this by using display: 'auto'
when configuring axes.
scales: {
y: {
type: 'linear' as const,
display: 'auto',
...
},
...
},
So on disabling a dataset the axis linked to it will also be hidden.