score:-1

Accepted answer

you should add the property line: false to your dataset.

for further details, please consult line dataset properties from chart.js documentation

score:1

in v3 of the lib this has become default behaviour, to achieve this in v2 you can do it in 2 ways, you can specify fill: false in every dataset or you can do it in the options for the line like so:

options: {
  elements: {
    line: {
      fill: false
    }
  },
}

example:

var labels = ["25\/04", "26\/04", "27\/04", "28\/04", "29\/04", "30\/04", "01\/05", "02\/05", "03\/05", "04\/05", "05\/05", "06\/05", "07\/05", "08\/05", "09\/05", "10\/05", "11\/05", "12\/05", "13\/05", "14\/05", "15\/05", "16\/05", "17\/05", "18\/05", "19\/05", "20\/05", "21\/05", "22\/05", "23\/05", "24\/05", "25\/05"];
var datasets = [{
  "label": "formul\u00e1rio site",
  "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  "backgroundcolor": "#4dc9f6",
  "bordercolor": "#4dc9f6"
}, {
  "label": "whatsapp",
  "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 24, 47, 24, 2, 4, 23, 0, 0, 0, 0, 0, 0, 0, 0],
  "backgroundcolor": "#f67019",
  "bordercolor": "#f67019"
}, {
  "label": "facebook",
  "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  "backgroundcolor": "#f53794",
  "bordercolor": "#f53794"
}, {
  "label": "call tracking",
  "data": [0, 27, 21, 11, 14, 20, 0, 0, 32, 22, 18, 28, 11, 0, 0, 16, 25, 22, 20, 23, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0],
  "backgroundcolor": "#537bc4",
  "bordercolor": "#537bc4"
}];
var uniqueid = '60acaa981f364';

var config = {
  type: 'line',
  data: {
    labels: labels,
    datasets: datasets
  },
  options: {
    elements: {
      line: {
        fill: false
      }
    },
    responsive: true,
    title: {
      display: true,
      text: 'leads diários'
    },
    tooltips: {
      mode: 'index',
      intersect: true,
    },
    hover: {
      mode: 'nearest',
      intersect: true
    },
    scales: {
      xaxes: [{
        display: true,
        scalelabel: {
          display: true,
          labelstring: 'dias'
        }
      }],
      yaxes: [{
        display: true,
        ticks: {
          beginatzero: true,
        },
        scalelabel: {
          display: true,
          labelstring: 'value'
        }
      }]
    }
  }
};

$(document).ready(function() {
  var ctx = document.getelementbyid(uniqueid).getcontext('2d');
  window.myline = new chart(ctx, config);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<canvas id="60acaa981f364" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.9.4/chart.js"></script>

fiddle: https://jsfiddle.net/leelenaleee/6dl4ut85/1/


Related Query

More Query from same tag