[Chartjs]-Charts.js straight lines – i cant find a solution

6👍

It looks like it’s been changed with v2.0. It is now tension:0. As of this writing the docs state it’s lineTension:0, but that seems incorrect.

10👍

Set the option bezierCurve to false.

window.onload = function(){
    var ctx = document.getElementById("canvas").getContext("2d");

    window.myLine = new Chart(ctx).Line(lineChartData, {
      responsive: true, 
      scaleFontColor: "#FF5972",
      bezierCurve: false
    });

});

It’s right there in the Line Chart option list.. You can also have them be curved but “stiffer” by leaving the option set and then varying the bezierCurveTension property.

Leave a comment