}
    $screen = $screen->get();
    $pre = new CPre();
    foreach ($screen as $text) {
        $pre->addItem([$text, BR()]);
    }
    $historyWidget->addItem($pre);
} else {
    $historyWidget->setTitle($header['left'])->setControls($header['right']);
    if (isset($this->data['iv_string'][$this->data['value_type']])) {
        $filterForm->addNavigator();
    }
    if (in_array($this->data['action'], [HISTORY_VALUES, HISTORY_GRAPH, HISTORY_BATCH_GRAPH])) {
        if (!isset($filterForm)) {
            $filterForm = new CFilter('web.history.filter.state');
        }
        // display the graph type filter for graphs with multiple items
        if ($this->data['action'] == HISTORY_BATCH_GRAPH) {
            $filterForm->addColumn((new CFormList())->addRow(_('Graph type'), (new CRadioButtonList('graphtype', (int) $this->data['graphtype']))->addValue(_('Normal'), GRAPH_TYPE_NORMAL)->addValue(_('Stacked'), GRAPH_TYPE_STACKED)->setModern(true)));
            $filterForm->removeButtons();
            $filterForm->addVar('fullscreen', $this->data['fullscreen']);
            $filterForm->addVar('action', $this->data['action']);
            $filterForm->addVar('itemids', $this->data['itemids']);
        }
        $filterForm->addNavigator();
        $historyWidget->addItem($filterForm);
    }
    $historyWidget->addItem($screen->get());
    CScreenBuilder::insertScreenStandardJs(['timeline' => $screen->timeline, 'profileIdx' => $screen->profileIdx]);
}
return $historyWidget;