use Chart::Graph::Gnuplot qw(gnuplot);
...
foreach my $config (@config)
{
my @sor;
foreach my $cle (sort numerique keys %$data)
{
push @sor, [$data->{$cle}{'date_format(date,"%d-%m-%Y")'},$data->{$cle}{'avg(mesures)'}];
}
push @courbe, [{'title' => $data_config->{'name'},
'style' => 'lines',
'type' => 'matrix'}, \@sor];
}
gnuplot({'title' => $soustitre,
'yrange' => "[0:]",
'xrange' => "['$date1':'$date2']",
'x-axis label' => 'jour',
'y-axis label' => 'moyenne',
'xdata' => 'time',
'timefmt' => '%d-%m-%Y',
'format' => ['x','%d-%m-%Y'],
'output type' => 'png',
'output file' => $file,
'extra_opts' => 'set key left top Left'},
@courbe);
Partager