var options;
$(document).ready(function() {
   var options = {
      chart: {
         renderTo: 'graph',
         defaultSeriesType: 'column'
      },
      title: {
         text: ''
      },
      xAxis: {
         categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
      },
      yAxis: {
         min: 0,
         title: {
            text: 'NFOs Stripped'
         },
         stackLabels: {
            enabled: false,
            style: {
               fontWeight: 'bold',
               color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
            }
         }
      },
      legend: {
         align: 'right',
         verticalAlign: 'top',
         floating: true,
         backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
         borderColor: '#CCC',
         borderWidth: 1,
         shadow: true
      },
      tooltip: {
         formatter: function() {
            return '<b>'+ this.x +'</b><br/>'+
                this.series.name +': '+ this.y +'<br/>'+
                'Total: '+ this.point.stackTotal;
         }
      },
      plotOptions: {
         column: {
            stacking: 'normal',
            dataLabels: {
               enabled: false,
               color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
            }
         }
      }
   };
   // Get it
   $.get('/stats/homepagegraphdata/', null, function(data) {
    options.series = data;
    var chart = new Highcharts.Chart(options);    
   }, 'json');
});
