Accepted answer

solution for version 1 (old charts version)

according to documentation on

you can set the 'beziercurve' in options and pass it in when you create the chart.

beziercurve: false


var options = {
    //boolean - whether the line is curved between points
    beziercurve : false
var myline = new chart(document.getelementbyid("canvas").getcontext("2d")).line(linechartdata, options);

update for version 2

according to updated documentation for line configuration in global options

name        type    default description
tension     number  0.4     default bezier curve tension. set to 0 for no bezier curves.


var options = {
    elements: {
        line: {
            tension: 0

and also directly in the dataset structure by setting linetension to 0 (zero).

property        type    usage
linetension     number  bezier curve tension of the line. set to 0 to draw straightlines. 
                        this option is ignored if monotone cubic interpolation is used. 
                        note this was renamed from 'tension' but the old name still works.

an example data object using these attributes is shown below.

var linechartdata = {
    labels: labels,
    datasets: [
            label: "my first dataset",
            linetension: 0,           
            data: data,


i think it's been updated to linetension. check the docs.


just to complete version compatibility and to add something to this nice thread here:

still the same with chart.js v3.x.x
(which is not backwards compatible with v2.x.x -- however, linetension stays unchanged within
data: { datasets: [{ linetension: ... )

linetension for chart.js v3.x.x

following, you can run the snippet with 10 buttons to play with different linetensions (0 to 1) right here:

// for now, let's assume sample data
let sample_data = {
  "labels" : [
  "values": [

// draw chart
const ctx = document.queryselector('canvas').getcontext('2d');

const mylinechart = new chart(ctx, {
  type: 'line',
  data: {
    labels: sample_data.labels,
    datasets: [{
      label: 'linetension sample',
      data: sample_data.values,
      linetension: 0,
      bordercolor: 'rgba(0,255,0,1)',
      backgroundcolor: 'rgba(0,255,0,0.3)',
      fill: true

function linetension(event) {
  // redraw the chart with modified linetension

  // a bit of 'button-cosmetics' here
  // enabling all buttons
  document.queryselectorall('button').foreach(element => element.disabled = false);
  // disabling the pressed button = true;

  // setting programmatically the 'linetension' here[0].linetension = parsefloat(;

  button {
    color: blue;
  button:disabled {
    color: black;
    background-color: rgba(0,255,0,0.3);
<script src=""></script>
<!-- gets you the latest version of chart.js, now at v3.5.0 -->

<button onclick="linetension(event)" data-linetension="0" disabled>0</button>
<button onclick="linetension(event)" data-linetension="0.1">0.1</button>
<button onclick="linetension(event)" data-linetension="0.2">0.2</button>
<button onclick="linetension(event)" data-linetension="0.3">0.3</button>
<button onclick="linetension(event)" data-linetension="0.4">0.4</button>
<button onclick="linetension(event)" data-linetension="0.5">0.5</button>
<button onclick="linetension(event)" data-linetension="0.6">0.6</button>
<button onclick="linetension(event)" data-linetension="0.7">0.7</button>
<button onclick="linetension(event)" data-linetension="0.8">0.8</button>
<button onclick="linetension(event)" data-linetension="0.9">0.9</button>
<button onclick="linetension(event)" data-linetension="1">1</button>

<canvas width="320" height="240"></canvas>


i have used linetension to set the smoothness of the curve.

from the docs: linetension receives a number, bezier curve tension of the line. set to 0 to draw straight lines. this option is ignored if monotone cubic interpolation is used.

just make sure to test with different values how smooth you want the line.

for example:

var data = {
  labels: ["jan", "feb", "mar"],
  datasets: [{
      label: "label 1",
      linetension: 0.2
    }, {
      label: "stock b",
      linetension: 0.2



you can use linetension option to set the desired curve. set 0 for straight lines. you can give a number between 0-1

data: {
    datasets: [{
        linetension: 0

Related Query

More Query from same tag