簡體   English   中英

php rrd_graphs評論位置幾乎每次更改

[英]php rrd_graphs comments position change almost every time

我對rrd grap有問題-每次看起來都不同。

例如:這些是使用相同功能一張一張地生成的2張圖。

第一

第二名

我的rrd_graph選項如下所示:

"--slope-mode",
        "--start", $start,

        "--font=DEFAULT:9:Cantarell",
        "--font=TITLE:12:Roboto Condensed",
        "--font=AXIS:8:Roboto Condensed",
        "--font=LEGEND:9:Cantarell",
        "--font=WATERMARK:6:Cantarell",

        "--title=$title",
        "-W General",
        "--vertical-label=Tx[dBm] / Rx[dBm] / SNR[dB]",
        "--lower=0",
        "-w 550",
        "-h 300",
        "-P",
        "--border=0",
        "--color=BACK#ffffff",
        "DEF:Tx=$RRD_CM_PATH$cm_mac_mod.rrd:US_Tx:AVERAGE",
        "DEF:SNR=$RRD_CM_PATH$cm_mac_mod.rrd:US_SNR:AVERAGE",
        "DEF:Rx=$RRD_CM_PATH$cm_mac_mod.rrd:US_Rx:AVERAGE",
        "COMMENT:\\n",
        "COMMENT:\\t\\t\\t\\t\\t\\t\\t\\t    Current\\t\\t  Average\\t\\tMinimum\\t      Maximum",
        "COMMENT:\\n",
        "COMMENT:\\t\\t\\t",
        "LINE3:Tx#055499:US Tx\\t\\t\\t",
        "GPRINT:Tx:LAST:%2.1lfdBm \\t",
        "GPRINT:Tx:AVERAGE:%2.1lfdBm \\t",
        "GPRINT:Tx:MAX:%2.1lfdBm \\t",
        "GPRINT:Tx:MIN:%2.1lfdBm \\t",
        "COMMENT:\\n",
        "COMMENT:\\t\\t\\t",
        "LINE3:SNR#ff5a00:US SNR\\t\\t",
        "GPRINT:SNR:LAST:%2.1lfdBm\\t",
        "GPRINT:SNR:AVERAGE:%2.1lfdBm\\t",
        "GPRINT:SNR:MAX:%2.1lfdBm\\t",
        "GPRINT:SNR:MIN:%2.1lfdBm\\t",
        "COMMENT:\\n",
        "COMMENT:\\t\\t\\t",
        "LINE3:Rx#4be117:US_Rx\\t",
        "GPRINT:Rx:LAST:%2.1lfdBm\\t",
        "GPRINT:Rx:AVERAGE:%2.1lfdBm\\t",
        "GPRINT:Rx:MAX:%2.1lfdBm\\t",
        "GPRINT:Rx:MIN:%2.1lfdBm\\t",
        "COMMENT:\\n",

我忘了分享解決方案...我用2件東西解決了一個問題:

  1. 等寬字體。
  2. 帶有固定寬度字符串的sprintf:

      sprintf('COMMENT:%25s%13s%13s%14s%13s', "", "Current", " Average", "Maximum", "Minimum"), "COMMENT:\\\\n", "COMMENT: \\\\n", "COMMENT:\\\\t", sprintf("LINE3:Rx#055499:%-9s%-10s", "DS Rx", "[dBm]"), sprintf("GPRINT:Rx:LAST:%-13s", "%4.1lf"), sprintf("GPRINT:Rx:AVERAGE:%-13s", "%4.1lf"), sprintf("GPRINT:Rx:MAX:%-13s", "%4.1lf"), sprintf("GPRINT:Rx:MIN:%-13s", "%4.1lf"), "COMMENT:\\\\n", "COMMENT:\\\\t", sprintf("LINE3:SNR#ff5a00:%-9s%-10s", "DS SNR", "[dB]"), sprintf("GPRINT:SNR:LAST:%-13s", "%4.1lf"), sprintf("GPRINT:SNR:AVERAGE:%-13s", "%4.1lf"), sprintf("GPRINT:SNR:MAX:%-13s", "%4.1lf"), sprintf("GPRINT:SNR:MIN:%-13s", "%4.1lf"), "COMMENT:\\\\n", "COMMENT:\\\\t", sprintf("LINE3:MR#4be117:%-9s%-10s", "MicroRef", "[-dBc]"), sprintf("GPRINT:MR:LAST:%-13s", "%4.1lf"), sprintf("GPRINT:MR:AVERAGE:%-13s", "%4.1lf"), sprintf("GPRINT:MR:MAX:%-13s", "%4.1lf"), sprintf("GPRINT:MR:MIN:%-13s", "%4.1lf"), "COMMENT:\\\\n", 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM