Skip to content

Instantly share code, notes, and snippets.

@nekoruri
Last active December 20, 2015 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekoruri/6138232 to your computer and use it in GitHub Desktop.
Save nekoruri/6138232 to your computer and use it in GitHub Desktop.
Zabbixのグラフで日付表示時に時刻を省略して縦幅を縮めるパッチ。Zabbix 2.0.6 にて動作確認済み。 /usr/share/zabbix とかに行って patch -p0 で食わせてください。
--- include/classes/class.cchart.php.orig 2013-08-02 07:55:09.131739793 +0000
+++ include/classes/class.cchart.php 2013-08-02 07:58:21.199739718 +0000
@@ -34,7 +34,7 @@
$this->skipRightScale = 0; // in case if right axis should be drawn but doesn't contain any data
$this->ymin_itemid = 0;
$this->ymax_itemid = 0;
- $this->legendOffsetY = 90;
+ $this->legendOffsetY = 50;
$this->percentile = array(
'left' => array(
'percent' => 0, // draw percentage line
@@ -1249,7 +1249,7 @@
// first && last
// start
- $str = zbx_date2str(_('d.m H:i'), $this->stime);
+ $str = zbx_date2str(_('d.m'), $this->stime);
$dims = imageTextSize(8, 90, $str);
imageText(
$this->im,
@@ -1264,7 +1264,7 @@
// end
$endtime = $this->to_time;
- $str = zbx_date2str(_('d.m H:i'), $endtime);
+ $str = zbx_date2str(_('H:i'), $endtime);
$dims = imageTextSize(8, 90, $str);
imageText(
$this->im,
@@ -1283,7 +1283,7 @@
$date_format = _('d.m');
}
else {
- $date_format = _('d.m H:i');
+ $date_format = _('d.m');
}
$color = $this->graphtheme['highlightcolor'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment