Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
multidirectional.php
1<?php
2
4
7
8
17{
18 const VIEW_KEY = 'multiDirectional';
19
22
26 public function __construct()
27 {
28 parent::__construct();
29 $this->setLabel(Loc::getMessage('REPORT_MULTI_LINEAR_GRAPH_VIEW_LABEL'));
30 $this->setLogoUri('/bitrix/images/report/visualconstructor/view-multiple-direction.png');
31 }
32
39 public function handlerFinallyBeforePassToView($dataFromReport)
40 {
41 $result = parent::handlerFinallyBeforePassToView($dataFromReport);
42 $result['categoryAxis'] += array(
43 'dashLength' => 1,
44 'minorGridEnabled' => true
45 );
46 $result['valueAxes'] = array(
47 array(
48 "id" => "v1",
49 "axisColor" => "#FF6600",
50 "axisThickness" => 2,
51 "axisAlpha" => 1,
52 "position" => "left"
53 ),
54 array(
55 "id" => "v2",
56 "axisColor" => "#FFFCCC",
57 "axisThickness" => 2,
58 "axisAlpha" => 1,
59 "position" => "right",
60 )
61 );
62
63 $isAllReportModeIsDate = true;
64 foreach ($dataFromReport as $key => $report)
65 {
66 if (!isset($report['config']['mode']) && $report['config']['mode'] !== 'date')
67 {
68 $isAllReportModeIsDate = false;
69 break;
70 }
71 if ($report['config']['reportColor'])
72 {
73 $result['valueAxes'][$key]["axisColor"] = $report['config']['reportColor'];
74 }
75 }
76 $result['categoryAxis']['parseDates'] = $isAllReportModeIsDate;
77
78 foreach ($result['graphs'] as $key => &$graph)
79 {
80 $graph['valueAxis'] = $result['valueAxes'][$key]['id'];
81 }
82 return $result;
83 }
84
91 public function collectReportHandlerFormElements($reportHandler)
92 {
93 parent::collectReportHandlerFormElements($reportHandler);
94 $removeReportControlFormElement = $reportHandler->getFormElementByDataAttribute('role', 'report-remove-button');
95 if ($removeReportControlFormElement)
96 {
97 $reportHandler->removeFormElement($removeReportControlFormElement);
98 }
99 }
100
101
102}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29