draw dotted line for line chart - Javascript Chart.js

Javascript examples for Chart.js:Line Chart

Description

draw dotted line for line chart

Demo Code

ResultView the demo in separate window

<html lang="en">
   <head> 
      <style>

.myChartDiv {//www .ja v  a 2  s.c om
   max-width: 600px;
   max-height: 400px;
}


      </style> 
   </head> 
   <body translate="no">   
      <div class="myChartDiv"> 
         <canvas id="myChart" width="600" height="400"></canvas> 
      </div>   
      <script src="https://npmcdn.com/chart.js@latest/dist/Chart.bundle.min.js"></script> 
      <script>
      var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
    type: 'line',
    data: {
        labels: ["Red", "Blue", "Yellow"],
        datasets: [{
            label: '# of Votes',
            data: [12, 19, 3],
            borderDash: [10,5]
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                }
            }]
        }
    }
});
      //# sourceURL=pen.js
    
      </script>  
   </body>
</html>

Related Tutorials