<? if($graphReport['priorities'] !=-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="reportPriority">              
		<div class="list-group no-radius no-border text-xs text-left pull-left" id="priorityOps">					  
		<? 
		$priorityCount = $perCnt = $priorityName = array();
		$total = 0;
			if(is_array($graphReport['priorities']))
			{
				foreach($graphReport['priorities'] as $priority)
				{
					$priorityCount[] = $priority['priorityCnt'];
					$priorityName[] = $priority['ticket_priority'];
				}
				$priorities = json_encode($priorityCount);
				$priorityName = json_encode($priorityName);
				$colors = $this->generateUniqueHexColors(count($priorityCount)+5);
				$uniqueColorsPriority = json_encode(array_unique($colors));
				$opAreaPriority = "#priorityOps";$chartAreaPriority = ".priorities_sparkline";
				echo "<script>display_pie_charts_data($priorities,$priorityName,$uniqueColorsPriority,'".$opAreaPriority."','".$chartAreaPriority."');</script>";
			}
		?>
		</div>
		<div class="priorities_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">	
