Column chart with axis customization - CanvasJS JavaScript Charts

Column chart with axis customization - 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: "Column Chart - Hiding Axis"
  },
  axisX:{
    lineThickness: 0,
    tickLength: 0,
    interval: 1,
    valueFormatString: "####"
  },
  axisY: {
    lineThickness: 0,
    gridThickness: 0,
    tickLength: 0,
    suffix: "M"
  },
  data: [
    {
      type: "column",
      color: "rgb(29, 51, 61)",
      indexLabel: "{y}M",
      indexLabelPlacement: "inside",
      xValueFormatString: "####",
      toolTipContent: "{x}: {y}M",
      dataPoints: [
        { x: 2011, y: 1.11 },
        { x: 2012, y: 0.95 },
        { x: 2013, y: 0.88 },
        { x: 2014, y: 1.88 },
        { x: 2015, y: 2.23 },
        { x: 2016, y: 3.1 }
      ]
    }					
  ]
});

chart.render();