Source
$legend_lines_mode_field = $form->registerField(new CWidgetFieldRadioButtonListView($fields['legend_lines_mode']));
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* Graph widget form view.
*
* @var CView $this
* @var array $data
*/
use Widgets\SvgGraph\Includes\{
CWidgetFieldDataSet,
CWidgetFieldDataSetView,
CWidgetFieldOverrideView
};
$form = new CWidgetFormView($data);
$preview = (new CDiv())
->addClass(ZBX_STYLE_SVG_GRAPH_PREVIEW)
->addItem((new CDiv())->setId('svg-graph-preview'));
$form_tabs = (new CTabView())
->addTab('data_set', _('Data set'), getDatasetTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_DATASET
)
->addTab('displaying_options', _('Displaying options'), getDisplayOptionsTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_DISPLAY_OPTIONS
)
->addTab('time_period', _('Time period'), getTimePeriodTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_TIME_PERIOD
)
->addTab('axes', _('Axes'), getAxesTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_AXES
)
->addTab('legend_tab', _('Legend'), getLegendTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_LEGEND
)
->addTab('problems', _('Problems'), getProblemsTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_PROBLEMS
)
->addTab('overrides', _('Overrides'), getOverridesTab($form, $data['fields']),
TAB_INDICATOR_GRAPH_OVERRIDES
)
->addClass('graph-widget-config-tabs')
->setSelected(0);
$form
->addItem([$preview, $form_tabs])
->addJavaScript($form_tabs->makeJavascript())