Basic Column Chart with Color - CanvasJS JavaScript Charts

Basic Column Chart with Color - CanvasJS JavaScript Charts

by canvasjs

HTML

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer",
	{
        
      data: [
      {
        type: "column",
        color: "#6699FF",
        dataPoints: [
        { x: 10, y: 71 },
        { x: 20, y: 55 },
        { x: 30, y: 50 },
        { x: 40, y: 65 },
        { x: 50, y: 85 },        
        ]
      },
      {
        type: "column",
        color: "#CDBFAC",
        dataPoints: [
        { x: 60, y: 31 },
        { x: 70, y: 75 },
        { x: 80, y: 90 },
        { x: 90, y: 65 },
        { x: 100, y: 45 },        
        ]
      },
      {
        type: "column",
        color: "#E1D4C0",
        dataPoints: [
        { x: 110, y: 79 },
        { x: 120, y: 84 },
        { x: 130, y: 70 },
        { x: 140, y: 80 },
        { x: 150, y: 70 },        
        ]
      }
      ]
    });

 chart.render();