if(isset($graph_type))
{
	if($graph_type!="depth")
		$graph_type="time";
}
else
	$graph_type="time";

$arFilter = Array(
	"date1"				=> $find_date1,
	"date2"				=> $find_date2,
	"id"				=> $find_counter_id,
);

$arrData=CLOLYandexMetrika::GetTrafficDeepness($arFilter);

if($graph_type=="depth")
	$data_key="data_depth";
else
	$data_key="data_time";

$total = count($arrData[$data_key]);
$arChart=array();
foreach($arrData[$data_key] as $key => $arVal)
{
	$color = GetNextRGB($color, $total);
	$arChart[] = array("COUNTER"=>$arVal["visits"], "COLOR"=>$color);
}

$ImageHandle = CreateImageHandle($diameter, $diameter);