Source
<?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/>.
**/
/**
* SVG graphs axis class.
*/
class CSvgGraphAxis extends CSvgGroup {
private const ZBX_STYLE_CLASS = 'svg-graph-axis';
private const ZBX_STYLE_GRAPH_AXIS_LEFT = 'svg-graph-axis-left';
private const ZBX_STYLE_GRAPH_AXIS_RIGHT = 'svg-graph-axis-right';
private const ZBX_STYLE_GRAPH_AXIS_BOTTOM = 'svg-graph-axis-bottom';
/**
* Axis triangle icon size.
*
* @var int
*/
private const ZBX_ARROW_SIZE = 5;
private const ZBX_ARROW_OFFSET = 5;
/**
* Array of labels. Key is coordinate, value is text label.
*
* @var array
*/
private $labels;
/**
* Axis type. One of CSvgGraphAxis::AXIS_* constants.
*
* @var int
*/
private $type;
/**
* Color for labels.
*
* @var string
*/
private $text_color;
/**
* Color for axis.
*
* @var string
*/
private $line_color;