2011-04-17 49 views
1

我正在使用RRDtool來繪製圖形。如何在RRDtool的相同高度上顯示兩行?

現在,這個命令:

rrdtool graph temp.png \ 
    -w 600 -h 200 \ 
    --zoom 1 \ 
    --title "last 24 hours temperature" \ 
    --vertical-label "temperature (°C)" \ 
    --alt-autoscale \ 
    --alt-y-grid \ 
    --start end-1d \ 
    --force-rules-legend \ 
    --legend-position=south \ 
    --rigid \ 
    --slope-mode \ 
    --font "DEFAULT:12:century schoolbook l" --watermark "$(date '+%F %T %Z')" \ 
    DEF:temperature=temp.rrd:temp:AVERAGE \ 
    GPRINT:temperature:LAST:"Current temp.\: %.2lf°C\r" \ 
    LINE1:temperature\#007070:"Mainboard\l" 

使我這個圖片:

Mainboard temperature

正如你所看到的,傳說和文字 「當前溫度:42.00°C」,不會出現在相同的高度(基線)。

我該如何讓這些線條出現在彼此旁邊,一個左側浮動,另一個右側浮動?

回答

2

你可以試試...

rrdtool graph temp.png \ 
    -w 600 -h 200 \ 
    --zoom 1 \ 
    --title "last 24 hours temperature" \ 
    --vertical-label "temperature (°C)" \ 
    --alt-autoscale \ 
    --alt-y-grid \ 
    --start end-1d \ 
    --force-rules-legend \ 
    --legend-position=south \ 
    --rigid \ 
    --slope-mode \ 
    --font "DEFAULT:12:century schoolbook l" --watermark "$(date '+%F %T %Z')" \ 
    DEF:temperature=temp.rrd:temp:AVERAGE \ 
    LINE1:temperature\#007070:"Mainboard" \ 
    GPRINT:temperature:LAST:"Current temp.\: %.2lf°C\j" 

注意,我身邊翻轉的最後兩行,並添加\j

+0

這個作品!然而'\ j'是什麼意思?是否合理? – polemon 2011-04-18 07:07:29

+0

是的,這意味着合理 – 2011-04-22 09:59:49

相關問題