本文整理汇总了PHP中CMacrosResolverHelper::resolveGraphName方法的典型用法代码示例。如果您正苦于以下问题:PHP CMacrosResolverHelper::resolveGraphName方法的具体用法?PHP CMacrosResolverHelper::resolveGraphName怎么用?PHP CMacrosResolverHelper::resolveGraphName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMacrosResolverHelper
的用法示例。
在下文中一共展示了CMacrosResolverHelper::resolveGraphName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawHeader
public function drawHeader()
{
if (!isset($this->header)) {
$str = $this->items[0]['hostname'] . NAME_DELIMITER . $this->items[0]['name'];
} else {
$str = CMacrosResolverHelper::resolveGraphName($this->header, $this->items);
}
if ($this->period) {
$str .= $this->period2str($this->period);
}
// calculate largest font size that can fit graph header
// TODO: font size must be dynamic in other parts of the graph as well, like legend, timeline, etc
for ($fontsize = 11; $fontsize > 7; $fontsize--) {
$dims = imageTextSize($fontsize, 0, $str);
$x = $this->fullSizeX / 2 - $dims['width'] / 2;
// most important information must be displayed, period can be out of the graph
if ($x < 2) {
$x = 2;
}
if ($dims['width'] <= $this->fullSizeX) {
break;
}
}
imageText($this->im, $fontsize, 0, $x, 24, $this->getColor($this->graphtheme['textcolor'], 0), $str);
}