
$(document).ready(function(){

  // HOMEPAGE CHART
  var chart = new Highcharts.Chart({
  chart: {
    renderTo: 'chart',
    defaultSeriesType: 'column',
    backgroundColor : '#F9F9F9',
    className: 'indexchart',
        margin: [10, 0, 50, 25],
        spacingBottom: 0,
        spacingLeft: 30,
        style: {
          fontFamily: 'Arial, sans-serif',
          fontColor: '#2a2a2a'
        }
  },
  title: {
    text: null
  },
  subtitle: {
    text: null
  },
  xAxis: {
    categories: ['Forests', 'Farmland', 'Freshwater', 'Marine', 'Bees', 'Mammals', 'Birds', 'Diseases', 'Plants', 'Invertebrates', 'Fish', 'Amphibians'],
    title: {
      text: null
    },
    labels: {
            rotation: -45,
            align: 'right',
            y: 8,
            style: {
                font: 'normal 10px Arial, sans-serif',
                color: '#2a2a2a',
            	fontWeight: 'normal'
            }
         }
  },
  yAxis: {
    min: 0,
    max: 800,
    gridLineWidth: 1,
    gridLineColor: '#eaeaea',
    labels: {
            enabled: true,
			align: 'left',
			x: -5,
			y: -2
        },
    title: {
      text: 'No. of studies',
      align: 'high',
      style: {
            fontFamily: 'Arial, sans-serif',
            color: '#2a2a2a'
          }
    }
  },
  tooltip: {
        enabled: false
    },
  plotOptions: {
    column: {
      dataLabels: {
        enabled: true
      },
      borderWidth: 0,
      groupPadding: 0.05
    }
  },
  legend: {
    enabled: false
  },
  credits: {
    enabled: false
  },
    series: [{
    name: 'Number of articles',
    data: [{name: 'Forests', color: '#FDC382', y: 519}, {name: 'Farmland', color: '#FDC382', y: 358}, {name: 'Freshwater', color: '#FDC382', y: 270}, {name: 'Marine', color: '#FDC382', y: 51}, {name: 'Bees', color: '#FB8501', y: 168}, {name: 'Mammals', color: '#FDC382', y: 141}, {name: 'Birds', color: '#FDC382', y: 811}, {name: 'Diseases', color: '#FDC382', y: 13}, {name: 'Plants', color: '#FDC382', y: 750}, {name: 'Invertebrates', color: '#FDC382', y: 394}, {name: 'Fish', color: '#FDC382', y: 150}, {name: 'Amphibians', color: '#FDC382', y: 50}],
    shadow: false,
    dataLabels: {
      enabled: false,
      rotation: -45,
      color: '#2a2a2a',
      x: -3,
      y: 10,
      formatter: function() {
        return this.y;
      },
      style: {
        font: 'normal 13px Verdana, sans-serif'
      }
    },
    states: {
            hover: {
                brightness: 0
            }
        }     
  }]
  });
  
});
