<? if($graphReport['ticket_types'] !=-1): ?>
<script>
	var dept = $('#department_id option:selected').text();$('.otherSelected').val(dept);
	var durationID = $('#duration option:selected').val(); if(durationID == 4){var custom = $('#vis_graphical_report_from_date').val()+ " to " +$('#vis_graphical_report_to_date').val(); $('.durationSelected').val(custom);}else{var duration = $('#duration option:selected').text();$('.durationSelected').val(duration);}
</script>
<div class="col-sm-6 portlet">
		<div class="panel-body text-center" id="reportTypes">
		  <div class="list-group no-radius no-border text-xs text-left pull-left" id="typesOps">					 
		  <? 
			$typeCount = $typeName = array();
			$total = 0;
				if(is_array($graphReport['ticket_types']))
				{
					foreach($graphReport['ticket_types'] as $ticket)
					{
						$typeCount[] = $ticket['typeCnt'];
						$typeName[] = $ticket['ticket_type'];
					}
					$types = json_encode($typeCount);
					$typeNms = json_encode($typeName);
					$colors = $this->generateUniqueHexColors(count($typeCount)+5); 
					$uniqueColorsChannels = json_encode(array_unique($colors));
					$opArea = "#typesOps";$chartArea = ".types_sparkline";
					echo "<script>display_pie_charts_data($types,$typeNms,$uniqueColorsChannels,'".$opArea."','".$chartArea."');</script>";
				}
		?>
		   </div>  	
		  <div class="types_sparkline" style="height:180px"></div>
		</div>
</div>
<? else: echo '<script> $("#pdfGraphExport").hide();</script>'?>
<? include(VIS_PATH_TEMPLATE.'no_record_yet.php');  ?>
<? endif; ?>
<input class="durationSelected" type="hidden">
<input class="otherSelected" type="hidden">	
