I’m creating a Chart.js graph and I want to hide the scales and grid to have a “cleaner” design but I’m having difficulties hiding that stuff.
const xyValues = Array.from({ length: 200 }, (_, i) => i + 10)
function generateChart() {
const myChart = new Chart("myChart", {
type: 'line',
options: {
legend: {
display: false
},
scales:{
x:{
border: {
display: false
},
grid: {
display: false,
drawOnChartArea: false,
drawTicks: false,
}
}
}
},
data: {
labels: xyValues,
datasets: [{
data: [192.0, 191.0, 190.0, 189.0, 187.0, 186.0, 185.0, 185.0, 184.0 ... ],
borderColor: "darkgray",
backgroundColor: "darkgray",
pointRadius: 1,
cubicInterpolationMode: 'monotone',
tension: 0.4,
fill: true
}]
}
}
);
}
But this is the result:
Grid, borders and scales are all visible and I don’t know how to solve this.