$(function () {
    var chart;
    $(document).ready(function() {
		// Build the chart
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'Distance_pie',
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Classes by Distance Flown'
            },
            tooltip: {
        	    pointFormat: '{series.name}: {point.percentage}%',
            	percentageDecimals: 0
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        formatter: function() {
                            return ''+ this.point.name +': '+ Math.round(this.percentage*10)/10 +' %';
                        }
                    }
                }
            },
            series: [{
                type: 'pie',
                name: 'Distance by Class',
                data: [
                ]
            }]
        });
    });
});