Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thicker X-Axis with Charts.js

Using the Chart.bundle.js script (documentation here), I've created a Line Chart within a object in javascript. Furthermore, my x-axis is numerical, ranging from -100 to 100. It is very important to me that there be a clear distinction between negative and positive numbers, and so I am trying to show a clear, bold x-axis on my Chart object; however, it doesn't seem like Chart.js provides this feature-or perhaps I just cannot find it. Is there any way of making a thicker x-axis? I am open to both conventional solutions as well as hacky ones, if necessary.

like image 933
David C Avatar asked Oct 25 '25 08:10

David C


1 Answers

In your options, you can set the lineWidth option:

options: {
   scales: {
      xAxes: [{ 
        gridLines: { lineWidth: 50 },
     }]
  }
}

And the corresponding docs

like image 83
Dominic K Avatar answered Oct 26 '25 22:10

Dominic K