<script type="text/javascript">

Highcharts.chart('container_P_mer', {
	chart: {
		type: 'spline',
		zoomType: 'x',
        resetZoomButton: {
            position: {
                // align: 'right', // by default
                // verticalAlign: 'top', // by default
                x: -30,
                y: -37
            }
        },
		height:"25%",
		marginLeft: 50,
		marginRight: <?php echo $legend_margin_right; ?>,
		marginTop:40,
		marginBottom:50,
		spacingLeft:0,
		plotBorderColor: '#346691',
		plotBorderWidth: 2,
		borderWidth: 1
	},

    credits: {
        enabled: false
    },

	tooltip: {
		xDateFormat: '%d/%m - %H:%M',
		enabled: <?php echo $show_tooltip_status; ?>,
		valueSuffix: ' hPa'
	},
	
	plotOptions: 
	{
		spline: 
		{
			marker: {
				enabled: false
			}
		},
        series: {
			animation: false,
            states: {
                hover: {
                    enabled: <?php echo $show_tooltip_status; ?>
                }
            }
        }
	},

	title: { <?php echo $title_P_mer_HighCharts;?>,
	},

	xAxis: {
		startOnTick: true,
		endOnTick: true,
		tickColor:"#000000",
		tickLength:5,
		tickInterval: 1*3600*1000,
		gridLineColor:"#CFCFCF",
		gridLineWidth: 1,
        min: <?php echo 1000*$start;?>,
        max: <?php echo 1000*$stop;?>,
		type: 'datetime',
		dateTimeLabelFormats: { // don't display the dummy year
		month: '%e. %b',
		year: '%b'
		}
	},

	yAxis: 
	{ 
		offset: 0,
		min: <?php echo $P_mer_min; ?>,
		max: <?php echo $P_mer_max; ?>,
		tickInterval: <?php echo $P_mer_Tick_intervalle; ?>,
		tickColor:"#000000",
		tickLength:5,
		tickWidth: 1,
		allowDecimals: false,
		showFirstLabel:true,
		showLastLabel: true,
		gridLineColor:"#C9C9CB",
		gridLineWidth: 1,
		gridLineDashStyle: 'Solid',
		minorTicks: true,
		minorTickInterval: 1,
		minorGridLineColor:"#C9C9CB",
		minorGridLineDashStyle: 'Solid',
		minorGridLineWidth:1,
		labels:{
			align: 'right',
			x: -10,
			y: 5,
			style: { 
				color: "#000000",
				fontSize: "12px"
			}
		},
		title: {
			text: 'hPa',
			x:60,
			y:-15,
			align: "high",
			style: { 
				color: "#000000",
				fontSize: "20px"
				},
			rotation: 0
		}
	},
			
	legend: {
		enabled: <?php echo $legend_status;?>,
		itemStyle: {"color": "#333333", "cursor": "pointer", "fontSize": "12px", "fontWeight": "bold", "textOverflow": "ellipsis"},
		backgroundColor: 'white',
		floating: true,
		layout: 'vertical',
		align: 'right',
		verticalAlign: 'top',
		x: +4,
		y: +20
	},

<?php 
echo "
	series: 
	[
"; 
	
for ( $i = 0; $i < $NB_sondes; $i++ ) {
$index_couleur = $i % $NB_couleurs;
if ($Flag_SONDE_OK[$i]) {

echo "
		{
			type: 'spline',
			name: '";echo $nom_sonde[$i];echo "', 
			visible: true,
			color: '" . $couleur_courbes[$index_couleur] . "',
			lineWidth: " . $HC_lineWidth . ", 
			data: [ 
"; 
					echo join($data_AQCM05[$i][4], ','); 
if ($i == $NB_sondes-1) {
	echo "
					  ]
			}";
} else {
	echo "
					  ]
			},";
}

}

}

echo "
	]
";


?>
	
});

</script>

