S
Sokar
Hello,
I have a script which creates a pie chart from the following lines of code:
my @values = (["$val1", "$val2", "$val3", "$val4"],
[$var1, $var2, $var3, $var4]);
my $graph = GD::Graph:ie->new(300, 300);
$graph->set(
title => "Status of students for
year: $year",
'3d' => 1,
) or warn $graph->error;
my $image = $graph->plot(\@values) or die "cant print graph\n";
open(IMG, ">pie1.jpeg") or die $!;
binmode IMG;
print $image->jpeg;
close IMG;
This bit of code actually creates a jpeg and stores it on the hard drive.
What I am looking to do is actually create the graph and then e-mail it to a
person. I was wondering if anyone knew how I could maybe instead of writing
the graph into an actual jpeg, write it into a variable and then e-mail the
variable as a jpeg to an e-mail address, to save me having the created jpegs
sitting on my hard drive.
Thanks and regards
John
I have a script which creates a pie chart from the following lines of code:
my @values = (["$val1", "$val2", "$val3", "$val4"],
[$var1, $var2, $var3, $var4]);
my $graph = GD::Graph:ie->new(300, 300);
$graph->set(
title => "Status of students for
year: $year",
'3d' => 1,
) or warn $graph->error;
my $image = $graph->plot(\@values) or die "cant print graph\n";
open(IMG, ">pie1.jpeg") or die $!;
binmode IMG;
print $image->jpeg;
close IMG;
This bit of code actually creates a jpeg and stores it on the hard drive.
What I am looking to do is actually create the graph and then e-mail it to a
person. I was wondering if anyone knew how I could maybe instead of writing
the graph into an actual jpeg, write it into a variable and then e-mail the
variable as a jpeg to an e-mail address, to save me having the created jpegs
sitting on my hard drive.
Thanks and regards
John