Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line chart disable interpolation

Tags:

chart.js

Is it anyway to disable interpolation in line chart using chartjs? I just red entire documentation and didnt find anything about this.

@UPDATE

lineTension: 0 is the thing I was looking for. (Thanks @tektiv for the answer)

like image 794
ulou Avatar asked Sep 28 '16 14:09

ulou


1 Answers

You need to edit the lineTension property (check the documentation), stored in the dataset :

datasets: [{
    label: "My First dataset",
    lineTension: 0,
    data: [/* ... */],
    // ...
}]

Setting it to 0 will prevent the interpolation from working.

You can see the result on this jsFiddle, and here is a screenshot :

enter image description here

like image 163
tektiv Avatar answered Sep 21 '22 01:09

tektiv