Class ::rrd::Graph (public)
::nx::Class ::rrd::Graph
Defined in packages/rrd-tool/tcl/rrd-procs.tcl
- Testcases:
- No testcase defined.
Source code: :property filename :property name :property -incremental {elements:0..n ""} :property {period seconds} # time range properties :property start :property end :property step # labels :property title :property vertical-label # size :property {width:integer 400} :property {height:integer 175} :property only-graph:switch :property fill-size-mode:switch # limits :property upper-limit :property lower-limit :property rigid:switch :property alt-autoscale:switch :property alt-autoscale-min:switch :property alt-autoscale-max:switch :property no-gridfit:switch # x-axis :property x-grid :property x-grid-none:switch :property week-fmt # y-axis :property y-grid :property y-grid-none:switch :property left-axis-formatter :property left-axis-format :property alt-y-grid:switch :property logarithmic:switch :property units-exponent:integer :property units-length:integer # --units=si? :property right-axis :property right-axis-label :property right-axis-formatter :property right-axis-format # legend :property no-legend:switch :property force-rules-legend:switch :property legend-position :property legend-direction # misc :property lazy:switch :property daemon :property imginfo :property {color:0..n {FONT#666666 ARROW#CFD6F8}} ;# can be specified multiple times :property grid-dash :property border:integer :property dynamic-labels:switch :property zoom :property {font:0..n { "DEFAULT:0:DejaVuSans,DejaVu Sans,DejaVu LGC Sans,Bitstream Vera Sans" LEGEND:7:monospace TITLE:12 AXIS:8 UNIT:8 }} :property font-render-mode :property font-smoothing-threshold :property pango-markup:switch :property graph-render-mode :property slope-mode:switch :property {imgformat PNG} :property interlaced:switch :property tabwidth:integer :property {base:integer 1000} :property {watermark "nx-rrd 0.1"} :property use-nan-for-all-missing-data:swtich :method init {} { next if {![info exists name]} { set :name [namespace tail [self]] } if {![info exists filename]} { set :imgname ${:name}.[string tolower ${:imgformat}] set :filename $::acs::rootdir/www/${:imgname} } } :public method imgName {} { return ${:imgname} } :public method render {} { 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 }XQL Not present: Generic, PostgreSQL, Oracle