Sometimes, we want to remove color underneath lines from a Chart.js line charts with JavaScript.
In this article, we’ll look at how to remove color underneath lines from a Chart.js line charts with JavaScript.
How to remove color underneath lines from a Chart.js line charts with JavaScript?
To remove color underneath lines from a Chart.js line charts with JavaScript, we set the fill
option to false
.
For instance, we write
const data = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "Dataset",
fill: false,
data: [1, 2, 3],
},
],
};
to set fill
to false
to remove the color underneath the lines in the line chart.
Conclusion
To remove color underneath lines from a Chart.js line charts with JavaScript, we set the fill
option to false
.