Beispiel #1
0
                     $maxY = max($maxY, $dataValue);
                     $arData[$rowIndex]['COLORS'][$columnIndex - 1][0] = $color;
                     if ($rowIndex === 0) {
                         $arLegendInfo[$columnIndex - 1] = $color;
                     }
                     $color = GetNextRGB($color, $nColors);
                 }
             }
         }
         // </editor-fold>
         // <editor-fold defaultstate="collapsed" desc="paint bar diagram">
         $imageHandle = $ImageHandle = CreateImageHandle($width, $height);
         $arYNorm = GetArrayY($arYAll, $minY, $maxY);
         $arrTTF_FONT = array('type' => 'bar', 'X' => array('FONT_PATH' => '/bitrix/components/bitrix/report.view/ttf/verdana.ttf', 'FONT_SIZE' => 8, 'FONT_SHIFT' => 12, 'FONT_BASE' => 3), 'Y' => array('FONT_PATH' => '/bitrix/components/bitrix/report.view/ttf/verdana.ttf', 'FONT_SIZE' => 8, 'FONT_SHIFT' => 12, 'FONT_BASE' => 3));
         $gridInfo = DrawCoordinatGrid($arXLabels, $arYNorm, $width, $height, $imageHandle, $backgroundColor, 'B1B1B1', '000000', 10, 2, $arrTTF_FONT);
         Bar_Diagram($imageHandle, $arData, $minY, $maxY, $gridInfo);
         // </editor-fold>
     } else {
         $errorCode = 43;
     }
     // At least one row of values is required
 } else {
     if ($chartData['type'] === 'pie') {
         if (count($chartData['data']) >= 1) {
             // <editor-fold defaultstate="collapsed" desc="prepare data for pie chart">
             $arConsolidated = array();
             foreach ($chartData['data'] as $rowIndex => $dataRow) {
                 $index = $dataRow[0];
                 $arConsolidated[$index] += $dataRow[1];
             }
             $sumAll = 0.0;
			"DATA" => $arRec,
			"COLORS" => $arColors,
		);
		$arrX[] = $arData["date"];
	}
	
	$arrY = GetArrayY($arrY, $MinY, $MaxY);

	$arrTTF_FONT["type"] = "bar";
	$gridInfo = DrawCoordinatGrid($arrX, $arrY, $width, $height, $ImageHandle, "FFFFFF", "B1B1B1", "000000", 15, 2, $arrTTF_FONT);

	/******************************************************
			data plot
	*******************************************************/
	if(is_array($gridInfo))
		Bar_Diagram($ImageHandle, $arGraphData, $MinY, $MaxY, $gridInfo);
}
else
{
	$arrData=CLOLYandexMetrika::GetTrafficSummary($arFilter);
	foreach($arrData["data"] as $arData)
	{
		$date = MakeTimeStamp($arData["date"]);

		$date_tmp = 0;
		// when dates come not in order
		$next_date = AddTime($prev_date, 1, "D");
		if(($date > $next_date) && (intval($prev_date) > 0))
		{
			// fill date gaps
			$date_tmp = $next_date;