bash RRDTool 图例标签放置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4822162/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 23:21:31  来源:igfitidea点击:

RRDTool legend label placement

linuxbashrrdtool

提问by Adrian

My titles in the right column are in the wrong place. Can anyone help me to correct?

我在右栏中的标题在错误的地方。谁能帮我改正?

rrdtool graph ... \
COMMENT:'   ' \  
"LINE1:kliensek#0000FF:Csatlakozott kliensek száma" \  
COMMENT:'           ' \  
"LINE2:aktivkliensek#99FF00:Aktív kliensek száma" \  
COMMENT:"\n" \  
GPRINT:kliensek:LAST:"    Legutóbbi\:%7.0lf%s" \  
COMMENT:"                    " \  
GPRINT:aktivkliensek:LAST:"Legutóbbi\:%7.0lf%s\n" \  
GPRINT:kliensek:MIN:"     Minimum\:%9.0lf%s" \  
COMMENT:"             " \  
GPRINT:kliensek:MIN:"     Minimum\:%9.0lf%s\n" \  
GPRINT:kliensek:MAX:"     Maximum\:%9.0lf%s" \  
GPRINT:aktivkliensek:MAX:"Maximum\:%9.0lf%s"      

I can't position the last title in the right column to the left.

我无法将最后一个标题放在右侧的左侧列中。

GPRINT:aktivkliensek:MAX:"Maximum\:%9.0lf%s"

Also in the right column, the first title

同样在右栏中,第一个标题

PRINT:kliensek:LAST:"     Legutóbbi\:%7.0lf%s"

is at the wrong place by 1 pixel. The minimum title only is OK.

位于错误的位置 1 个像素。只有最小标题是可以的。

采纳答案by gorthx

Here are some things to try:

以下是一些可以尝试的事情:

  1. Add a newline (\n) at the end of your last line.
  2. Remove the space from the beginning of your second "Minimum" label.
  3. You have a line: COMMENT:' ' between the two LAST and two MIN statements; add that between your two MAX statements too (or get rid of it altogether)
  4. Not related to the formatting - You have two entries for "kliensek:MIN" - is that intentional?
  1. 在最后一行的末尾添加一个换行符 (\n)。
  2. 删除第二个“最小”标签开头的空格。
  3. 您有一行: COMMENT:' ' 在两个 LAST 和两个 MIN 语句之间;也在你的两个 MAX 语句之间添加它(或完全摆脱它)
  4. 与格式无关 - 您有两个“kliensek:MIN”条目 - 这是故意的吗?

So you should have:

所以你应该有:

GPRINT:kliensek:LAST:" Legutóbbi\:%7.0lf%s" \
COMMENT:" " \
GPRINT:aktivkliensek:LAST:"Legutóbbi\:%7.0lf%s\n" \
GPRINT:kliensek:MIN:" Minimum\:%9.0lf%s" \
COMMENT:" " \
GPRINT:aktivkliensek:MIN:"Minimum\:%9.0lf%s\n" \
GPRINT:kliensek:MAX:" Maximum\:%9.0lf%s" \
COMMENT:" " \
GPRINT:aktivkliensek:MAX:"Maximum\:%9.0lf%s\n"

回答by Tobi Oetiker

You could also use tabs and maybe switch to a more tabular presentation

您还可以使用选项卡,并可能切换到更表格化的演示文稿

                avg      min     max
   Line A        22       10      24
   Line B        23        8      30

Hope this helps

希望这可以帮助