Bar Chart with Percentage - CanvasJS JavaScript Charts

Bar Chart with Percentage - 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",
    {
      title:{
      text: "Bar Chart with Percent"
      },
      data: [
      {      	
        type: "bar",
        //indexLabel : "{y}%",
        toolTipContent: "{y}%",
        dataPoints: [
        { x: new Date(2012, 01, 1), y: 71 },
        { x: new Date(2012, 02, 1), y: 55 },
        { x: new Date(2012, 03, 1), y: 50 },
        { x: new Date(2012, 04, 1), y: 65 },
        { x: new Date(2012, 05, 1), y: 95 }
        ]
      }
      ]
    });

    chart.render();