ChartJS Stacked lines

by Piotr Kulpinski

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js"></script>
<body>
    <canvas id="chartJSContainer" width="600" height="400"></canvas>
</body>

CSS

canvas { background-color : #eee;
}

JavaScript

var options = {
  type: 'line',
  data: {
    labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
    datasets: [
	    {
	      label: '# of Votes',
	      data: [12, 19, 3, 5, 2, 3],
        fill: 'origin',
      	borderWidth: 1,
        backgroundColor: 'rgba(255, 125, 0, 0.5)'
    	},	
			{
				label: '# of Points',
				data: [7, 11, 5, 8, 3, 7],
        fill: 'origin',
				borderWidth: 1,
        backgroundColor: 'rgba(0, 125, 255, 0.5)'
			}
		]
  },
  options: {
    elements: {
      line: {
      	fill: '-1'
      }
    },
    scales: {
      yAxes: [{
      	stacked: true
      }]
    }
  }
}

var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);