Source
this._flickerfreescreen_container = this._flickerfreescreen.querySelector('.dashboard-widget-graph-link');
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
class CWidgetGraph extends CWidget {
_init() {
super._init();
this._is_graph_mode = false;
}
_doActivate() {
if (this._is_graph_mode) {
this._activateGraph();
}
super._doActivate();
}
_doDeactivate() {
if (this._is_graph_mode) {
this._deactivateGraph();
}
super._doDeactivate();
}
resize() {
super.resize();
if (this._is_graph_mode && this.getState() === WIDGET_STATE_ACTIVE) {
const graph_size = this._getGraphSize();
if (graph_size.width <= 0 || graph_size.height <= 0) {
return;
}
const image = document.getElementById('graph_' + this._unique_id);
if (!image.complete) {
image.addEventListener('load', () => this.resize(), {once: true});
return;
}
timeControl.objectList['graph_' + this._unique_id].objDims.width = graph_size.width;