$(document).ready(function() {
	var chart = new Highcharts.Chart({
		chart: {
			renderTo: 'container',
			margin: [20, 40, 135, 140],
			zoomType: 'xy',
			alignTicks: false
		},
		title: {
			text: '',
			style: {
				margin: '10px 0 0 0' // center it
			}
		},
		subtitle: {
			text: '',
			style: {
				margin: '0 0 0 0' // center it
			}
		},
		xAxis: [{
			categories: Gegner,
		labels: {
			rotation: -45,
			align: "right"
		}
		}],
		yAxis: [{ 
			// Secondary yAxis
			title: {
				text: '',
				margin: 60,
				style: {
					color: '#4572A7'
				}
			},
			labels: {
				formatter: function() {
					return this.value;
				},
				style: {
					color: '#4572A7'
				}
			},
			tickInterval: 2,
			min: 0,
			max: max_moegliche_Punkte,
			minorGridLineWidth: 0, 
			gridLineWidth: 0,
			reversed: false,
			opposite: true,
					plotBands: [{ // Verloren
						from: 0,
						to: max_moegliche_Punkte / 2,
						color: 'rgba(240, 170, 68, .1)'
					}, { // Gewonnen
						from: max_moegliche_Punkte / 2,
						to: max_moegliche_Punkte,
						color: 'rgba(68, 240, 170, .1)'
					}]

		}, { 
			// Primary yAxis
			labels: {
				formatter: function() {
					return this.value;
				},
				style: {
					color: '#89A54E'
				}
			},
			title: {
				text: '',
				style: {
					color: '#89A54E'
				},
				margin: 60
			},
			tickInterval: 1,
			min: 0,
			max: Anzahl_Mannschaften,
			minorGridLineWidth: 0, 
			gridLineWidth: 0,
			reversed: true
		}],
		tooltip: {
			formatter: function() {
				return '<b>'+ this.series.name +'</b><br/>'+
				(
					this.series.name == 'Platz' ? 
						this.y + '. Platz' 
					: 
						this.x + ': ' + this.y + " : " + (max_moegliche_Punkte - this.y)
				);
			}
		},
		legend: {
			layout: 'vertical',
			style: {
				left: '10px',
				bottom: 'auto',
				right: 'auto',
				top: '40px'
			},
			backgroundColor: '#FFFFFF'
		},
		series: [{
			name: 'Ergebnis',
			color: '#4572A7',
			type: 'column',
			data: Ergebnisse
		}, {
			name: 'Platz',
			color: '#89A54E',
			type: 'line',
			yAxis: 1,
			data: Plaetze
		}]
	});
	
	
});
