#!d:/bin/perl-w use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use GD::Graph::pie; use DBI; my $DBH; my $STH; ###Datenbankverbindung### $DBH=DBI->connect("DBI:CSV:Auswertung=d:/Programme/Apache Group/Apache/Apache2/cgi-bin") or die "Konnte keine Verbindung zur Datenbank herstellen!$!\n"; $STH=$DBH->prepare("SELECT * FROM Auswertung") or die "Konnte SQL-Statement nicht bereitstellen!$!\n"; $STH->execute() or die "Ausführen nicht möglich!$!\n"; my @werte; my @res; while (@werte=$STH->fetchow_array();{ push @res, @werte; } $STH->finish(); $STH->disconnect; my @data=( [$res[0],[$res[3],[$res[6], [$res[1],[$res[4],[$res[7], [$res[2],[$res[5],[$res[8] ); my $my_graph=GD::Graph::pie->(new(300,300); $my_graph->set( x_label=>´???´, y_label=>´???´, title=>´Auswertung´ ); my $format=$my_graph->export_format; print header("image/$format"); binmode STDOUT; print $my_graph->plot(\@data)->$format();