<?
		
				// object setup	
					$tchart = new COM("turbochart.tchart");
				
				// echo this line to check your version number
					$tchart -> getversion(0);
	
				// uncomment this line if you are a registered user to remove watermark
					//$status = $tchart -> LicenseKey("My Name","1111-2222-3333");
				  
				
				// setup our colors once at the beginning of the script so that
				// we do not have to call rgbcolor more than once
				
					$cGreen = $tchart -> rgbcolor(10,160,10); // green 
					$cDGreen = $tchart -> rgbcolor(0,102,0); // green 
					
					$cBlue = $tchart -> rgbcolor(5,104,167); // blue 
					$cDBlue = $tchart -> rgbcolor(0,51,102); // blue 
										
					$cRed = $tchart -> rgbcolor(167,28,5); // red 
					$cDRed = $tchart -> rgbcolor(102,0,0); // red 
					
					$cBlack = $tchart -> rgbcolor(0,0,0);
					$cWhite = $tchart -> rgbcolor(255,255,255); // white 
										
					$cYellow = $tchart -> rgbcolor(160,160,10); // yellow 
					$cDYellow = $tchart -> rgbcolor(255,204,0); // yellow 
					
					$cPurple= $tchart -> rgbcolor(160,2,212); // purple 
					$cDPurple= $tchart -> rgbcolor(153,0,255); // purple 
					
					
					$bg = $tchart -> rgbcolor(221,221,221);
				
				
				
				// chart setup 
				
				  $status  = $tchart -> BeginChart(getcwd() . "\chart_5.jpg",1,700,350);
				  
				  $status  = $tchart -> SetBackGroundColor($bg);
			 	  $status = $tchart -> SetFont("Arial",16,$cBlack, False ,True,0);
	  			  $status = $tchart -> SetTitle("Productivity By Department");
					
				// bar setup
				  $status = $tchart -> Bar3dBegin(0,0,700,350,3,4,2,2);
				  				  
				  $status = $tchart -> SetFont("Arial",16,$cBlack, False ,True,0);
				  $status = $tchart -> Bar3dSetXaxisLabel("Deptartment",0);
				  $status = $tchart -> Bar3dSetYaxisLabel("Productivity",1);
								 
				  $status = $tchart -> SetFont("Arial",12,$cBlack, False ,True,0);
				  
				  $status = $tchart -> Bar3dSetColumnLabel("Hardware Sales",0);
				  $status = $tchart -> Bar3dSetColumnLabel("Software Sales",1);
				  $status = $tchart -> Bar3dSetColumnLabel("Corporate Sales",2);
				  
				  $status = $tchart -> Bar3dSetRowLabel("First Quarter",0);
				  $status = $tchart -> Bar3dSetRowLabel("Second Quarter",1);
				  $status = $tchart -> Bar3dSetRowLabel("Third Quarter",2);
				  $status = $tchart -> Bar3dSetRowLabel("Fourth Quarter",3);
				  
				 
				 $status = $tchart -> Bar3dHorizontalRefLine(80,$cRed,2);
				
				
				
			// values and color
				// we will dynmaically build an our to build our dark colors
				// on the bottom of the layer type
			
			
				$bar_color[0] = 'cDRed';
				$bar_color[1] = 'cDBlue';
				$bar_color[2] = 'cDGreen';
				
				
				$bar_color['0c'] = 'cRed';
				$bar_color['1c'] = 'cBlue';
				$bar_color['2c'] = 'cGreen';
				
				
			
			
			// loop through all possible bar, assign randomn values to the graph
			
				for($col = 0; $col < 3; $col ++):
				
					for($row = 0; $row < 4; $row ++):
					
						for($bar = 0; $bar < 3; $bar ++):
				
					
							  $status = $tchart -> Bar3dSetBarValue(rand(50,100)/2,$col,$row,$bar,0);
							  $status = $tchart -> Bar3dSetBarColor($$bar_color[$col], $col, $row, $bar, 0);
						
							  $status = $tchart -> Bar3dSetBarValue(rand(50,100)/2,$col,$row,$bar,1);
							  $status = $tchart -> Bar3dSetBarColor($$bar_color[$col . 'c'], $col, $row, $bar, 1);
						
							  
						endfor;
							  
					endfor;
				  
				endfor;

				  
				  
				  
		// finish bar		 			  				 
				 
				  
				  $status = $tchart -> Bar3dFinish(0);
		
				  
	   // legend setup
	   

					   $status  = $tchart -> LegendBegin(580,275,0,2,2,13);
					   
					   $status  = $tchart -> SetFont("Arial",14,$cBlack, False ,True,0);
					   $status  = $tchart -> LegendSetColumn(0,0,2,0);
					
					   $status  = $tchart -> LegendSetItemTextSpan("Productivity Legend", 0, 0, 2, 2);
					
					   $status  = $tchart -> LegendSetItemText("PCs", 1, 1);
					   $status  = $tchart -> LegendSetColorKey($cDBlue, 1, 0);
					   
					   $status  = $tchart -> LegendSetItemText("Servers", 2, 1);  
					   $status  = $tchart -> LegendSetColorKey($cBlue,2,0);
						
					   
					   $status  = $tchart -> LegendSetItemText("Turbo Chart", 3, 1);
					   $status  = $tchart -> LegendSetColorKey($cDRed, 3, 0);
					   
					   $status  = $tchart -> LegendSetItemText("Log Rover", 4, 1);
					   $status  = $tchart -> LegendSetColorKey($cRed, 4, 0);
					   
					   $status  = $tchart -> LegendSetItemText("Custom SQL", 5, 1);
					   $status  = $tchart -> LegendSetColorKey($cDGreen, 5, 0);
					   
					   $status  = $tchart -> LegendSetItemText("ECOM", 6, 1);
					   $status  = $tchart -> LegendSetColorKey($cGreen, 6, 0);
					   
		//finish legend
					   
					   $status  = $tchart -> LegendFinish(0);
					   
		
		
		
		// finish chart
		   
				  $status = $tchart -> FinishChart(0);
				 
				 
				 
				
?>

<img src="chart_5.jpg">