in reply to help with rrdtool::oo and dinamic draw

it looks like the graph method, (though not shown) is converting the calling parameters into a hash. And that's what you start off expecting when suddenly you put @draw at the end of the call parameters, which has three elements (forcing total odd). You need to exchange @draw for something like some_key => \@draw I would imagine.

One world, one people

  • Comment on Re: help with rrdtool::oo and dinamic draw

Replies are listed 'Best First'.
Re^2: help with rrdtool::oo and dinamic draw
by guacamayo (Acolyte) on Apr 21, 2011 at 13:18 UTC
    Hi! Thanks, a step further :-) and now ..
    foreach my $row (@sensor_h) { push(@draw, { file => "../data/$row.rrd", legend => "Source 1", thic +kness => 2, color => '00FF00' }); }
    $rrd->graph( #image => '-', image => "../images/" . $sensor . ".png", vertical_label => 'Sensors', width => $width, height => $height, start => time() - $period, draw => { file => "../data/sensor1.rrd", legend => "Source + 1", thickness => 2, color => '00FF00' }, draw => $draw[0], draw => $draw[1], ... and so on ... );
    yes, so works but i need to pass or join a hash with more draw occurrences thanks