Line chart border lines in boundaries for chartjs - Javascript Chart.js

Javascript examples for Chart.js:Line Chart

Description

Line chart border lines in boundaries for chartjs

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script> 
      <script type="text/javascript">
    window.onload=function(){/*from w ww  . j  a  va2s.c  o  m*/
var canvas = document.getElementById('myChart');
var data = {
  labels: ["January", "February", "March", "April", "May", "June", "July"],
  datasets: [{
    label: 'Counts',
    data: [0, 0, 20, 0, 0, 100, 100],
    fill: false,
    lineTension: 0.1,
    backgroundColor: 'rgba(75,192,192,0.4)',
    borderWidth: 3,
    borderColor: 'rgba(75,192,192,1)',
    borderCapStyle: 'round',
    borderJoinStyle: 'round',
    pointBorderColor: 'rgba(75,192,192,1)',
    pointBackgroundColor: '#fff',
    pointBorderWidth: 1,
    pointHoverRadius: 5,
    pointHoverBackgroundColor: 'rgba(75,192,192,1)',
    pointHoverBorderColor: 'rgba(220,220,220,1)',
    pointHoverBorderWidth: 2,
    pointRadius: 3,
    pointHitRadius: 20,
    pointStyle: 'circle',
  }]
};
var myBarChart = Chart.Line(canvas, {
  data: data,
  options: {
    scales: {
      yAxes: [{
        ticks: {
          min: -20,
          max: 140
        }
      }]
    }
  }
});
    }

      </script> 
   </head> 
   <body> 
      <canvas id="myChart" width="500" height="300"></canvas>  
   </body>
</html>

Related Tutorials