<script>

	var	SPL_valeur	= <?php echo($AQCM05_SPL); ?>;
	var	SPL_color	= '<?php echo($AQCM05_SPL_color); ?>';
	var	SPL_mini 	= <?php echo($SPL_mini); ?>;
	var	SPL_maxi 	= <?php echo($SPL_maxi); ?>;
 
	var SPL_config = {
		
		type: 'doughnut',
		
		data: {
			datasets: [{
				data: [ SPL_valeur - SPL_mini, SPL_maxi - SPL_valeur ],
				backgroundColor: [SPL_color, gauges_inactive_ring_color],
				borderColor: '#000000',
				borderWidth: gauges_line_width
			}]
		},
		
		options: {
			
			radius: gauges_radius,
			cutout: gauges_cutout,
			layout: {
				padding: {
					left: 6,
					right: 6
				}
			},			
			responsive: true,
			maintainAspectRatio: false,
			rotation: -90,
			circumference: 180,
			
			animation: {
				animateRotate: false,
				animateScale: false
			},
			
			watermark: {
				image: image_SPL,
				x: emoticon_x,
				y: emoticon_y,
				width: emoticon_width,
				height: emoticon_height,
				opacity: 1,
				alignX: "right",
				alignY: "top",
				alignToChartArea: false,
				position: "back",
			},
			
			plugins: {

				tooltip: {
					enabled: false
				},
				
				annotation: {
					annotations: {
						labelMin: {
							content: [SPL_mini],
							type: 'label',
							xValue: 0,
							xAdjust: mini_x_adjust,
							yValue: 0,
							yAdjust: mini_y_adjust,
							color: gauges_text_color,
							backgroundColor: gauges_background_color,
							font: [{size: mini_maxi_font_size, weight: 'normal'}, {family: 'Arial'}],
						},
						labelMax: {
							content: [SPL_maxi],
							type: 'label',
							xValue: 0,
							xAdjust: maxi_x_adjust,
							yValue: 0,
							yAdjust: maxi_y_adjust,
							color: gauges_text_color,
							backgroundColor: gauges_background_color,
							font: [{size: mini_maxi_font_size, weight: 'normal'}, {family: 'Arial'}],
						},
						labelValue: {
							content: [SPL_valeur],
							type: 'label',
							textlign: 'center',
							xValue: 0,
							xAdjust: value_x_adjust,
							yValue: 0,
							yAdjust: value_y_adjust,
							color: gauges_text_color,
							backgroundColor: gauges_background_color,
							font: [{size: value_font_size, weight: 'normal'}, {family: 'Arial'}],
						},
						labelTitle: {
							content: ['niveau sonore'],
							type: 'label',
							xValue: 0,
							xAdjust: title_x_adjust,
							yValue: 0,
							yAdjust: title_y_adjust,
							color: gauges_text_color,
							backgroundColor: gauges_background_color,
							font: [{size: title_font_size, weight: 'normal'}, {family: 'Arial'}],
						},
						labelUnit: {
							content: ['dBA'],
							type: 'label',
							xValue: 0,
							xAdjust: unit_x_adjust,
							yValue: 0,
							yAdjust: unit_y_adjust,
							color: gauges_text_color,
							backgroundColor: gauges_background_color,
							font: [{size: unit_font_size, weight: 'normal'}, {family: 'Arial'}],
						},
					}
				}



				
			}

		}
		

		
	};

	var SPL_chartCtx = document.getElementById('gauge_SPL').getContext('2d');
	var gauge_SPL = new Chart(SPL_chartCtx, SPL_config);
		

</script>
