97 $resultWidget = parent::prepareWidgetContent($widget, $withCalculatedData);
98 if (!$withCalculatedData)
100 return $resultWidget;
102 if ($withCalculatedData)
104 $resultWidget[
'content'][
'params'][
'color'] = $widget->
getWidgetHandler()->getFormElement(
'color')->getValue();
111 catch (\Throwable $exception)
114 $error = $exception->getMessage();
117 if (!empty($result[
'data']) && static::MAX_RENDER_REPORT_COUNT > 1)
119 foreach ($result[
'data'] as $num => &$reportResult)
121 if (!isset($reportResult[
'config'][
'color']))
123 $reportResult[
'config'][
'color'] = $widget->
getWidgetHandler()->getReportHandlers()[$num]->getFormElement(
'color')->getValue();
126 if (!isset($reportResult[
'config'][
'title']))
128 $reportResult[
'title'] = $widget->
getWidgetHandler()->getReportHandlers()[$num]->getFormElement(
'label')->getValue();
132 $reportResult[
'title'] = $reportResult[
'config'][
'title'];
136 elseif (!empty($result[
'data']))
138 $reportResult[
'config'][
'color'] = $widget->
getWidgetHandler()->getReportHandlers()[0]->getFormElement(
'color')->getValue();
139 $reportResult[
'title'] = $widget->
getWidgetHandler()->getReportHandlers()[0]->getFormElement(
'label')->getValue();
147 $componentResult = $this->includeComponent();
149 $resultWidget[
'content'][
'params'][
'html'] = $componentResult[
'html'];
150 $resultWidget[
'content'][
'params'][
'css'] = $componentResult[
'css'];
151 $resultWidget[
'content'][
'params'][
'js'] = $componentResult[
'js'];
155 $errorResult = static::GetErrorHTML($error);
157 $resultWidget[
'content'][
'params'][
'html'] = $errorResult[
'html'];
158 $resultWidget[
'content'][
'params'][
'css'] = $errorResult[
'css'];
159 $resultWidget[
'content'][
'params'][
'js'] = $errorResult[
'js'];
162 return $resultWidget;