<script>

const P_title = '<?php echo( "  hPa      |  Patm  |  site : " . $p_aqcm_SITE_ID . "  |  " . $time_start_string . "  |" ); ?>' ;

var ctx_P = document.getElementById('Chart_P').getContext("2d");

chart_P = new Chart(ctx_P, {
	
	type: 'line',
  
	data: { 
		datasets: [ 
			<?php echo $data_P_mer; ?> 
		]
	},

	options: {
		
		animation: false,
		
		scales: {
			
			x: {
				
				type: 'time',
				
				min: <?php echo 1000*$start;?>,
				max: <?php echo 1000*$stop;?>,
				
				time: {
					unit: '<?php echo $time_unit; ?>',
					displayFormats: {
						minute : 'HH:mm',
						hour: 'HH:mm',
						hours: 'dd/MM  HH:mm',
						day:  'dd/MM  HH:mm'
					},
					tooltipFormat: 'DD T'
				},
				
				
				ticks: {
					
					stepSize: <?php echo $x_stepSize; ?>,
					color: TICKS_color,
					autoSkip: false,
					font: {
						size: TICKS_font_size_x,
						weight: 'normal', 
						family: 'Arial',  
						style: 'normal'  
					}
				},
				grid:{
					color: color_of_grids
				},
		
			},
			
			y: {
				
				min: <?php echo($FS_MIN_P_mer); ?>,
				max: <?php echo($FS_MAX_P_mer); ?>,
				ticks: {
					color: TICKS_color,
					labelOffset: 0,
					padding: OPTIONS_SCALES_Y_padding_array[OPTIONS_SCALES_Y_padding_index_P],
					autoSkip: true,
					font: {
						size: TICKS_font_size_y,
						weight: 'normal', 
						family: 'Arial',  
						style: 'normal'  
					}
				},
				grid:{
					color: color_of_grids
				},
				
			}
			
		},
		
		plugins: {
			
			legend: {
				position: 'right',
				labels: {
					boxWidth: LEGEND_box_width,
					boxHeight: LEGEND_box_height,
					color: LEGEND_box_color
				}
			},
		  
			title: {
				color: '#000000ff',
				display: true,    
				text: P_title, 
				position: 'top',   
				align: 'start',   
				fullSize: true,    
				font: {
					size: 20,       
					weight: 'normal', 
					family: 'Arial',  
					style: 'normal'  
				},
				padding: {
					top: 8,         
					bottom: 13,      
				}
			},
		  
			annotation: {
				annotations: {
					line0: {
						type: 'line',
						yMin: 1013.25,
						yMax: 1013.25,
						borderColor: '#000000',
						borderWidth: 3,
						display: true
					},
				}

			},
		
			tooltip: {
				enabled: tooltip_enabled
			}

		}
		
	}
  
});

</script>

