• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/view/customers/regularcustomersgraph.php
  • Класс: Bitrix\Crm\Integration\Report\View\Customers\RegularCustomersGraph
  • Вызов: RegularCustomersGraph::handlerFinallyBeforePassToView
public function handlerFinallyBeforePassToView($calculatedPerformedData)
{
	$result = parent::handlerFinallyBeforePassToView($calculatedPerformedData);

	$result['legend'] = [
		"data" => []
	];
	if(is_array($result['graphs']))
	{
		foreach ($result['graphs'] as $k => $graph)
		{
			$result['graphs'][$k]["bullet"] = "none";
			$result['graphs'][$k]["fillColorsField"] = "color";
			$result['graphs'][$k]["balloonFunction"] = "BX.Crm.Report.Dashboard.Content.RegularCustomers.renderBalloon";
			$result['graphs'][$k]["balloon"]["fillAlpha"] = 0;
			$result['graphs'][$k]["balloon"]["borderThickness"] = 0;
			$result['graphs'][$k]["balloon"]["maxWidth"] = 350;

			$result['legend']['data'][] = [
				'title' => $graph['title'],
				'color' => $graph['lineColor']
			];
		}
	}

	if(is_array($result['dataProvider']))
	{
		foreach ($result['dataProvider'] as $k => $item)
		{
			if($result['dataProvider'][$k]['value_1'] == 1)
			{
				// logarithmic scale workaround (log(1) == 0)
				$result['dataProvider'][$k]['value_1'] = 1.5;
			}
			$result['dataProvider'][$k]['color'] = $item['balloon']['color'];
		}
	}

	if ($result['chartCursor'])
	{
		$result['chartCursor']['categoryBalloonEnabled'] = false;
	}

	$result["clickGraphItem"] = "BX.Crm.Report.Dashboard.Content.RegularCustomers.onItemClick";

	return $result;
}