Source
private static function getProblems(array $metrics, array $problem_options, array $time_period, string $templateid,
<?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/>.
**/
namespace Widgets\SvgGraph\Includes;
use API,
CArrayHelper,
CHousekeepingHelper,
CItemHelper,
CMacrosResolverHelper,
CMathHelper,
CNumberParser,
CParser,
CSeverityHelper,
CSimpleIntervalParser,
CSvgGraph,
Exception,
Manager;
/**
* Class calculates graph data and makes SVG graph.
*/
class CSvgGraphHelper {
/**
* Calculate graph data and draw SVG graph based on given graph configuration.
*
* @param array $options Options for graph.
* array $options['data_sets'] Graph data set options.
* int $options['data_source'] Data source of graph.
* array $options['time_period'] Graph time period used.
* bool $options['fix_time_period'] Whether to keep time period fixed.
* array $options['left_y_axis'] Options for graph left Y axis.
* array $options['right_y_axis'] Options for graph right Y axis.
* array $options['x_axis'] Options for graph X axis.
* array $options['legend'] Options for graph legend.
* int $options['legend_lines'] Number of lines in the legend.
* array $options['problems'] Graph problems options.
* array $options['overrides'] Graph override options.
*
* @param int $width
* @param int $height
*
* @throws Exception
*
* @return array
*/
public static function get(array $options, int $width, int $height): array {
$metrics = [];
$errors = [];