Thread GDGraph (6 answers)
Opened by stef23 at 2006-07-11 13:40

renee
 2006-07-11 16:04
#68042 #68042
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Von welchem Typ ein Diagramm sein soll legst Du mit der Verwendung des Packages fest:
GD::Graph::bars->new(@dim) oder GD::Graph::hbars->new(@dim) oder new GD::Graph::lines(); oder oder oder...

Und zum Speichern steht das hier in der Doku:
Quote
and plot the graph.
Code: (dl )
  my $gd = $graph->plot(\@data) or die $graph->error;

Then do whatever your current version of GD allows you to do to save the file. For versions of GD older than 1.19 (or more recent than 2.15), you'd do something like:
Code: (dl )
1
2
3
4
  open(IMG, '>file.gif') or die $!;
binmode IMG;
print IMG $gd->gif;
close IMG;

and for newer versions (1.20 and up) you'd write
Code: (dl )
1
2
3
  open(IMG, '>file.png') or die $!;
binmode IMG;
print IMG $gd->png;

or
Code: (dl )
1
2
3
  open(IMG, '>file.gd2') or die $!;
binmode IMG;
print IMG $gd->gd2;
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread GDGraph