<script type="text/javascript">

	FS_CO2 = <?php echo($FS_MAX_CO2_moy); ?> ;
	if ( FS_CO2 > 2000 ) {
		CO2_step_size = 200;
	} else {
		CO2_step_size = 100;
	}

	//------------------------------------------------------
	// affichage initial
	//------------------------------------------------------
	{
		trigger_display 	= true;
		FS_max				= false;
		tooltip_enabled 	= false;
	}
	
	//------------------------------------------------------
	// lignes de TRIGGER
	//------------------------------------------------------
	{
		
		trig_line_width = 4.0 ;
		
		// 0 : T
		trig_line_T_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_T_max); ?> -  <?php echo($FS_MIN_T_min); ?> ) ;
		trig_line_T_moy		=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_T_moy); ?> -  <?php echo($FS_MIN_T_moy); ?> ) ;

		// 1 : HR
		trig_line_HR_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( 100 - 0 ) ;
		trig_line_HR_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( 100 - 0 ) ;

		// 2 : CO2
		trig_line_CO2_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts); ?>) ) * ( <?php echo($FS_MAX_CO2_max); ?> -  <?php echo($FS_MIN_CO2_min); ?> ) ;
		trig_line_CO2_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts); ?>) ) * ( <?php echo($FS_MAX_CO2_moy); ?> -  <?php echo($FS_MIN_CO2_moy); ?> ) ;

		// 3 : P
		trig_line_P_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_P_max); ?> -  <?php echo($FS_MIN_P_min); ?> ) ;
		trig_line_P_moy		=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_P_moy); ?> -  <?php echo($FS_MIN_P_moy); ?> ) ;

		// 4 : COV
		trig_line_COV_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( 500 - 0 ) ;
		trig_line_COV_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( 500 - 0 ) ;

		// 5 : PM25 PM10
		trig_line_PM_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_PM_max); ?> -  <?php echo($FS_MIN_PM_min); ?> ) ;
		trig_line_PM_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_PM_moy); ?> -  <?php echo($FS_MIN_PM_moy); ?> ) ;

		// 6 : HCHO
		trig_line_HCHO_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_HCHO_max); ?> -  <?php echo($FS_MIN_HCHO_min); ?> ) ;
		trig_line_HCHO_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_HCHO_moy); ?> -  <?php echo($FS_MIN_HCHO_moy); ?> ) ;

		// 7 : LUX
		trig_line_LUX_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_LUX_max); ?> -  <?php echo($FS_MIN_LUX_min); ?> ) ;
		trig_line_LUX_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_LUX_moy); ?> -  <?php echo($FS_MIN_LUX_moy); ?> ) ;

		// 8 : SPL
		trig_line_SPL_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_SPL_max); ?> -  <?php echo($FS_MIN_SPL_min); ?> ) ;
		trig_line_SPL_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_SPL_moy); ?> -  <?php echo($FS_MIN_SPL_min); ?> ) ;

		// 9 : NOX
		trig_line_NOX_IAQ_max 	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_NOX_IAQ_max); ?> -  <?php echo($FS_MIN_NOX_IAQ_min); ?> ) ;
		trig_line_NOX_IAQ_moy	=  ( trig_line_width / (10.0 * <?php echo($height_charts_small); ?>) ) * ( <?php echo($FS_MAX_NOX_IAQ_moy); ?> -  <?php echo($FS_MIN_NOX_IAQ_moy); ?> ) ;
		
	}

	//------------------------------------------------------
	// COULEURS
	//------------------------------------------------------
	{
		
		MIN_backgroundColor 		= '#00ff0040'	;
		MOY_backgroundColor 		= '#0000ff20'	;
		MAX_backgroundColor 		= '#ff000040'	;

		ANNOTATION_BOX_color		= '#c0c080c0' 	;
		
		color_of_grids				= '#bbbbbb';
		
		COV_IAQ_border_color		= '#000000ff' 	;
		COV_IAQ_backgroundColor		= '#ffff00ff' 	;

		PRES_border_color			= '#000000ff' 	;
		PRES_backgroundColor 		= '#000000FF'	;

		MIN_border_color			= '#000000ff' 	;
		MIN_above_color 			= '#ddeeff80'	;
		MIN_below_color 			= '#60708080'	;

		MOY_border_color			= '#000000ff' 	;
		MOY_backgroundColor_2		= '#00ff00E0'	;
		MOY_above_color 			= '#7dcea080'	;
		MOY_below_color 			= '#00800044'	;

		MAX_border_color			= '#000000ff' 	;
		MAX_above_color 			= '#ff000080'	;
		MAX_below_color 			= '#00800044'	;

		TICKS_color					= '#000000ff' 	;

		LEGEND_box_color			= '#000000FF' 	;

		TRIG_backgroundColor		= '#00000080' 	;
		TRIG_color_0				= '#00ff00c0' 	;
		TRIG_color_1				= '#FFFF00c0' 	;
		TRIG_color_2				= '#FFa000B0' 	;
		TRIG_color_3				= '#FF0000B0' 	;
		TRIG_color_4				= '#ff00ffB0' 	;
		TRIG_color_5				= '#00ffffB0' 	;

		GRAPH_SEUIL_lines_borderColor 		= '#000000ff'	;
		GRAPH_SEUIL_lines_backgroundColor	= '#000000ff'	;
	}

	//------------------------------------------------------
	// fontes
	//------------------------------------------------------
	TICKS_font_size_x			= 11		 	;
	TICKS_font_size_y			= 14		 	;

	//------------------------------------------------------
	// dimensions
	//------------------------------------------------------
	LEGEND_box_width			= 12 	;

	//------------------------------------------------------
	// placement de l'axe Y à gauche
	//------------------------------------------------------
	{
		OPTIONS_SCALES_Y_padding_array	= [50, 20, 17, 13, 8, 3] ;
		
		OPTIONS_SCALES_Y_padding_index_CO2		= 4;
		OPTIONS_SCALES_Y_padding_index_CO2_BOTH	= 4;
		if ( <?php echo($FS_MAX_CO2_moy); ?> >= 10000 ) {
			OPTIONS_SCALES_Y_padding_index_CO2		= 5;
			OPTIONS_SCALES_Y_padding_index_CO2_BOTH	= 5;
		}

		OPTIONS_SCALES_Y_padding_index_SPL = 2;
		if ( <?php echo($FS_MAX_SPL_max); ?> >= 100 ) { OPTIONS_SCALES_Y_padding_index_SPL = 3; }

		OPTIONS_SCALES_Y_padding_index_P = 3;
		if ( <?php echo($FS_MAX_P_moy); ?> >= 1000 ) { OPTIONS_SCALES_Y_padding_index_P = 4; }

		OPTIONS_SCALES_Y_padding_index_LUX = 3;
		if ( <?php echo($FS_MAX_LUX_moy); ?> >=  1000 ) { OPTIONS_SCALES_Y_padding_index_LUX = 4; }
		if ( <?php echo($FS_MAX_LUX_moy); ?> >= 10000 ) { OPTIONS_SCALES_Y_padding_index_LUX = 5; }

		OPTIONS_SCALES_Y_padding_index_PM = 2;
		if ( <?php echo($FS_MAX_PM_moy); ?> >=  100 ) { OPTIONS_SCALES_Y_padding_index_PM = 3; }
		if ( <?php echo($FS_MAX_PM_moy); ?> >= 1000 ) { OPTIONS_SCALES_Y_padding_index_PM = 4; }

		OPTIONS_SCALES_Y_padding_index_HCHO = 2;
		if ( <?php echo($FS_MAX_HCHO_moy); ?> >=  100 ) { OPTIONS_SCALES_Y_padding_index_HCHO = 3; }
		if ( <?php echo($FS_MAX_HCHO_moy); ?> >= 1000 ) { OPTIONS_SCALES_Y_padding_index_HCHO = 4; }

		OPTIONS_SCALES_Y_padding_index_NOX_IAQ = 2;
		if ( <?php echo($FS_MAX_NOX_IAQ_moy); ?> >=  100 ) { OPTIONS_SCALES_Y_padding_index_NOX_IAQ = 3; }
	}

	//------------------------------------------------------

</script>

