上QQ阅读APP看书,第一时间看更新
Adding a label and title to the graph
The first enhancement to our graph will be a label and a graph title so someone looking at the graph gets some additional information. For this you can use the --vertical-label and --title parameters:
rrdtool graph -w 500 data_image.png \ --start 1488153600 \ --end 1488218400 \ --vertical-label bps \ --title "Interface Speed" \ DEF:intspeed=test.rrd:data:AVERAGE \ LINE2:intspeed#FF0000
The resulting graph now has a title at the top and a description to the left as can be seen here:
As you can see, the RRDtool command added a rotated description to the Y-Axis and also added the title at the top of the graphs. The graph is now bigger in dimensions than the first one. The RRDtool uses the width and height information to set the actual chart size only. Everything else will be added to the graph. You can see this behavior throughout the next few examples.