Class ::rrd::Graph

::rrd::Graph[i] create ... \
           [ -alt-autoscale-max:boolean alt-autoscale-max:boolean ] \
           [ -alt-autoscale-min:boolean alt-autoscale-min:boolean ] \
           [ -alt-autoscale:boolean alt-autoscale:boolean ] \
           [ -alt-y-grid:boolean alt-y-grid:boolean ] \
           [ -base:integer (default "1000") ] \
           [ -border:integer border:integer ] \
           [ -color:0..n (default "FONT#666666 ARROW#CFD6F8") ] \
           [ -daemon daemon ] \
           [ -dynamic-labels:boolean dynamic-labels:boolean ] \
           [ -elements:0..n (default "") ] \
           [ -end end ] \
           [ -filename filename ] \
           [ -fill-size-mode:boolean fill-size-mode:boolean ] \
           [ -font-render-mode font-render-mode ] \
           [ -font-smoothing-threshold font-smoothing-threshold ] \
           [ -font:0..n (default " "DEFAULT:0:DejaVuSans,DejaVu Sans,DejaVu LGC Sans,Bitstream Vera Sans" LEGEND:7:monospace TITLE:12 AXIS:8 UNIT:8 ") ] \
           [ -force-rules-legend:boolean force-rules-legend:boolean ] \
           [ -graph-render-mode graph-render-mode ] \
           [ -grid-dash grid-dash ] \
           [ -height:integer (default "175") ] \
           [ -imgformat (default "PNG") ] \
           [ -imginfo imginfo ] \
           [ -interlaced:boolean interlaced:boolean ] \
           [ -lazy:boolean lazy:boolean ] \
           [ -left-axis-format left-axis-format ] \
           [ -left-axis-formatter left-axis-formatter ] \
           [ -legend-direction legend-direction ] \
           [ -legend-position legend-position ] \
           [ -logarithmic:boolean logarithmic:boolean ] \
           [ -lower-limit lower-limit ] \
           [ -name name ] \
           [ -no-gridfit:boolean no-gridfit:boolean ] \
           [ -no-legend:boolean no-legend:boolean ] \
           [ -only-graph:boolean only-graph:boolean ] \
           [ -pango-markup:boolean pango-markup:boolean ] \
           [ -period (default "seconds") ] \
           [ -right-axis right-axis ] \
           [ -right-axis-format right-axis-format ] \
           [ -right-axis-formatter right-axis-formatter ] \
           [ -right-axis-label right-axis-label ] \
           [ -rigid:boolean rigid:boolean ] \
           [ -slope-mode:boolean slope-mode:boolean ] \
           [ -start start ] \
           [ -step step ] \
           [ -tabwidth:integer tabwidth:integer ] \
           [ -title title ] \
           [ -units-exponent:integer units-exponent:integer ] \
           [ -units-length:integer units-length:integer ] \
           [ -upper-limit upper-limit ] \
           [ -use-nan-for-all-missing-data:swtich,slot=::rrd::Graph::slot::use-nan-for-all-missing-data use-nan-for-all-missing-data:swtich,slot=::rrd::Graph::slot::use-nan-for-all-missing-data ] \
           [ -vertical-label vertical-label ] \
           [ -watermark (default "nx-rrd 0.1") ] \
           [ -week-fmt week-fmt ] \
           [ -width:integer (default "400") ] \
           [ -x-grid x-grid ] \
           [ -x-grid-none:boolean x-grid-none:boolean ] \
           [ -y-grid y-grid ] \
           [ -y-grid-none:boolean y-grid-none:boolean ] \
           [ -zoom zoom ]

Defined in packages/rrd-tool/tcl/rrd-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::rrd::VolatileObject[i]
::nx::Class create ::rrd::Graph \
     -superclass ::rrd::VolatileObject

Methods (to be applied on instances)

  • elements (forward)

  • imgName (scripted, public)

     <instance of rrd::Graph[i]> imgName

    Testcases:
    No testcase defined.
    return ${:imgname}
  • render (scripted, public)

     <instance of rrd::Graph[i]> render

    Testcases:
    No testcase defined.
    set defs [list ${:filename}]
    
    foreach v [[current class] info variables] {
      set varName [:info variable name $v]
      #
      # the following four varnames are NOT from rrd, so don't pass
      # these as is to rrd.
      #
      if {$varName in {elements filename name period}} {
        continue
      }
      #
      # These are configuration variables from rrd
      #
      if {[info exists :$varName]} {
        switch -glob -- [lindex [:info variable parameter $v] 0] {
          *:boolean {
            if {[set :$varName]} {lappend defs --$varName}
          }
          *:0..n {
            foreach e [set :$varName] {
              lappend defs --$varName $e
            }
          }
          default   {    lappend defs --$varName [set :$varName]}
        }
      }
    }
    switch ${:period} {
      day     {set scale 34560}
      hours   {set scale 1440}        
      minutes {set scale 60}
      seconds -
      default {set scale 1}
    }
    foreach e ${:elements} { $e configure -scale $scale }
    
    lappend defs "COMMENT:          \t\t      Cur\tMin\t Avg\t   Max\\l"
    
    foreach e ${:elements} {
      lappend defs {*}[$e render]
    }
    # get the lastupdate from the last element
    lassign [[$e cget -datasource] lastupdate] ds secs value
    regsub -all {:} [clock format [string trimright $secs :]] {\:} ts
    
    lappend defs "COMMENT:Last update\\: $ts\\r"
    
    #append ::_ "<p>GRAPH<br>[join $defs <br>\n]<br>\n"
    return $defs