1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
storeprofitgraph.php
См. документацию.
1<?php
2
4
12
14{
15 public const ENABLE_SORTING = false;
16 public const VIEW_KEY = 'store_profit_graph';
17 public const MAX_RENDER_REPORT_COUNT = 1;
18 public const USE_IN_VISUAL_CONSTRUCTOR = false;
19
20 public function __construct()
21 {
22 parent::__construct();
23
24 $this->setLabel(Loc::getMessage('STORE_PROFIT_CHART_LABEL'));
25 $this->setDraggable(false);
26 Extension::load(["catalog.store-chart"]);
27 }
28
32 public function handlerFinallyBeforePassToView($dataFromReport)
33 {
34 $result = parent::handlerFinallyBeforePassToView($dataFromReport);
35
36 if (is_array($dataFromReport) && isset($result['valueAxes']))
37 {
38 foreach ($dataFromReport as $data)
39 {
40 if (empty($data['items']))
41 {
42 continue;
43 }
44
45 foreach ($data['items'] as $item)
46 {
47 if ($item['value'] < 0 && $result['valueAxes'][0]['minimum'] > $item['value'])
48 {
49 $result['valueAxes'][0]['minimum'] = $item['value'];
50 }
51 }
52 }
53 }
54
55 if (is_array($result['dataProvider']))
56 {
57 $result['categoryAxis']['autoGridCount'] = true;
58 $result['categoryAxis']['minHorizontalGap'] = 0;
59 $result['categoryAxis']['labelFrequency'] = ceil(count($result['dataProvider']) / 10);
60
61 foreach ($result['dataProvider'] as $k => $item)
62 {
63 if (!isset($result['dataProvider'][$k]['value_1']))
64 {
65 $result['dataProvider'][$k]['value_1'] = 0;
66 }
67 if (!isset($result['dataProvider'][$k]['value_2']))
68 {
69 $result['dataProvider'][$k]['value_2'] = 0;
70 }
71 }
72 }
73
74 if (is_array($result['graphs']))
75 {
76 $baseCurrency = CurrencyManager::getBaseCurrency();
77 foreach ($result['graphs'] as $k => $graph)
78 {
79 $result['graphs'][$k]["balloonFunction"] = "BX.Catalog.LinearGraphBalloon.renderBalloon";
80 $result['graphs'][$k]["balloon"]["borderThickness"] = 0;
81 $title = $result['graphs'][$k]['title'];
82 $amount = $dataFromReport[$k]['config']['amount'] ?? \CCurrencyLang::CurrencyFormat(0, $baseCurrency);
83 $result['graphs'][$k]["title"] = "$title ($amount)";
84 }
85 }
86
87 $result['legend']['valueText'] = '';
88 $result['legend']['align'] = 'center';
89
90 return $result;
91 }
92
96 public function getViewHandler(): BaseHandler
97 {
98 return new GraphHandler();
99 }
100}
static load($extNames)
Определения extension.php:16
setDraggable($draggable)
Определения view.php:453
setLabel($label)
Определения view.php:83
$data['IS_AVAILABLE']
Определения .description.php:13
$result
Определения get_property_values.php:14
if(!function_exists("bx_hmac")) $amount
Определения payment.php:30
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
$title
Определения pdf.php:123
$k
Определения template_pdf.php:567