26 parent::__construct();
28 $this->
setLogoUri(
'/bitrix/images/report/visualconstructor/view-pie.jpg');
30 $this->
setJsClassName(
'BX.Report.VisualConstructor.Widget.Content.AmChart.PieDiagram');
40 $viewTypes = parent::getCompatibleViewTypes();
41 $viewTypes[] =
'funnel';
42 $viewTypes[] =
'donutDiagram';
71 $result = parent::handlerFinallyBeforePassToView($dataFromReport);
73 $result[
'dataProvider'] = !empty($dataFromReport[
'items']) ? $dataFromReport[
'items'] : array();
75 foreach ($result[
'dataProvider'] as $number => &$data)
77 if (!isset($data[
'color']) && isset($customColors[$number]))
79 $data[
'color'] = $customColors[$number];
82 $result[
'titleField'] =
'label';
83 $result[
'valueField'] =
'value';
84 $result[
'colorField'] =
'color';
85 $result[
'outlineAlpha'] = 0.4;
86 $result[
'outlineColor'] =
"#FFFFFF";
87 $result[
'outlineThickness'] = 1;
88 $result[
'labelsEnabled'] =
false;
89 $result[
'legend'] = array(
90 "markerType" =>
"circle",
91 "position" =>
"right",
94 "autoMargins" =>
false
118 parent::collectReportHandlerFormElements($reportHandler);
121 $whatWillCalculateField = $reportHandler->getFormElement(
'calculate');
122 if ($whatWillCalculateField)
124 $labelField = $reportHandler->getWidgetHandler()->getFormElement(
'label');
125 $labelField->addJsEventListener($whatWillCalculateField, $whatWillCalculateField::JS_EVENT_ON_CHANGE, array(
126 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.Title',
127 'action' =>
'whatWillCalculateChange',
129 $whatWillCalculateField->addAssets(array(
130 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/reporttitle.js')
134 $removeFormElement = $reportHandler->getFormElementByDataAttribute(
'role',
'report-remove-button');
135 if ($removeFormElement)
137 $removeFormElement->setDisplay(
false);
140 $colorField = $reportHandler->getFormElement(
'color');
141 $reportHandler->getFormElement(
'label_color_container_start')->setDisplay(
false);
142 $reportHandler->getFormElement(
'label_color_container_end')->setDisplay(
false);
143 $reportHandler->getFormElement(
'head_container_start')->setDisplay(
false);
144 $reportHandler->getFormElement(
'head_container_end')->setDisplay(
false);
147 $colorField->setDisplay(
false);
151 $labelField = $reportHandler->getFormElement(
'label');
154 $labelField->setDisplay(
false);
static getMessage($code, $replace=null, $language=null)