Hightcharts Experiment

by anikettiwari

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 300px"></div>

JavaScript

$(function () {
    var colors = ['#0b92fb','#0b92fb','#0b92fb'];
    //var names = ['DC', 'FC','ITC'];
 
    $('#container').highcharts({

        chart: {
        height: 200,
            type: 'bar',
        },
        credits: {
        	enabled: false
        },
        legend: {
         enabled: true,
         legend: {
         labelFormatter: function() {
           if(this.name == "NPE" || this.name == "plaintiff"){
          return '';
        }else{
          return 'Entity';
        }
      },
      
    },
	    	},
        title: {
            text: ''
        },
        xAxis: {
            categories: ['DC', 'FC', 'ITC'],
            allowDecimals: false,
            lineWidth: 0,
            minorGridLineWidth: 0,
            lineColor: 'transparent',
            minorTickLength: 0,
            tickLength: 0
        },
        yAxis: {
             title: false,
        		 gridLineWidth: 0,
            allowDecimals: false,
            tickInterval: 10
        },
        plotOptions: {
          series: {
          groupPadding: 0,
        pointPadding: 0,
        pointWidth: 20,
        showInLegend: true,
         
                       dataLabels: {
              enabled: true
            }
          }
    },

        series: [
            {
                //pointWidth:10,
               
                color: colors[0],
               // showInLegend:false,
                data: [
                    {y: 6, name: 'DC', color: colors[0]},
                    {y: 7, name: 'FC', color: colors[1]},
                    {y: 9, name: 'ITC', color: colors[2]}
                    
                ]
            } 
            
            
        ],

    });

});