- else
-
- -- no graph handler, iterate over data types
- for i, dtype in ipairs( self.tree:data_types( plugin, plugin_instance ) ) do
-
- -- check for data type handler
- local dtype_def = plugin_def .. "." .. dtype
- local stat, def = pcall( require, dtype_def )
-
- if stat and def and type(def.rrdargs) == "function" then
-
- -- temporary image matrix
- local _images = { }
-
- -- get diagram definitions
- for i, opts in ipairs( self:_forcelol( def.rrdargs( self, plugin, plugin_instance, dtype ) ) ) do
-
- _images[i] = { }
-
- -- get diagram definition instances
- local diagrams = self:_generic( opts, plugin, plugin_instance, dtype, i )
-
- -- render all diagrams
- for j, def in ipairs( diagrams ) do
-
- -- remember image
- _images[i][j] = def[1]
-
- -- exec
- self:_rrdtool( def )
- end
- end
-
- -- remember images - XXX: fixme (will cause probs with asymmetric data)
- for y = 1, #_images[1] do
- for x = 1, #_images do
- table.insert( pngs, _images[x][y] )
- end
- end
- else
-
- -- no data type handler, fall back to builtin definition
- if type(self.defs.definitions[dtype]) == "table" then
-
- -- iterate over data type instances
- for i, inst in ipairs( self.tree:data_instances( plugin, plugin_instance, dtype ) ) do
-
- local title = self.i18n:title( plugin, plugin_instance, dtype, inst )
- local label = self.i18n:label( plugin, plugin_instance, dtype, inst )
- local png = self:mkpngpath( plugin, plugin_instance, dtype, inst )
- local rrd = self:mkrrdpath( plugin, plugin_instance, dtype, inst )
- local args = { png, "-t", title, "-v", label }
-
- for i, o in ipairs(self.defs.definitions[dtype]) do
- -- XXX: this is a somewhat ugly hack to exclude min/max RRAs when rrasingle is on
- if not ( self.opts.rrasingle and ( o:match("_min") or o:match("_max") ) ) then
- table.insert( args, o )
- end
- end
-
- -- remember image
- table.insert( pngs, png )
-
- -- exec
- self:_rrdtool( args, rrd )
- end
- end
- end
- end