How can I make two of my lines in Chart JS thicker

You were close to it !
Actually, the attribute you have to edit is not lineWidth but borderWidth (in the first example of Chart.js docs, you can see the attribute).


As stated in the example of the MDN doc of lineTo :

Use the beginPath() to begin a path to draw a line on, move the pen with moveTo() and use the stroke() method to actually draw the line.

The line is basically a rectangle with a width of 0. Then the width of the line is calculated using the rectangle border width.


So you simply have to edit your dataset this way :

datasets: [{
    // ...
    borderWidth: 1 // and not lineWidth
    // ...
}]

I also have updated your fiddle with the edit, and you can see that it is working now.

Leave a Comment