Leser: 1
3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package BD2;
require Exporter;
use GD::Graph::bars;
our @ISA = qw("Exporter");
our @Exporter=qw($BalkenD uegabe);
our @Exporter_OK=qw();
our $Version=1.00;
###### Art des Graphes #####
my $graph = new GD::Graph::bars(400, 400);
###### Attribute des Graphen #####
$graph->set(
x_label => 'Gel-Nr.',
y_label => 'Intensität',
title => 'Dot-Analyse',
y_max_value => 16,
y_tick_number => 8,
y_label_skip => 2,
bar_spacing => 1
);
###### Werte ######
sub uegabe {
push (@Speicher, @_);
for (0..5){
$data[0][$_]=$Speicher[$_];
$data[1][$_]=$Speicher[$_+6];
$data[2][$_]=$Speicher[$_+12];
}
}
#my @data = (
#["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
#[ 1, 2, 5, 6, 3, 1.5, 1, 3, 4],
#[ 10, 12, 5, 9, 1, 2, 1, 7, 8]
#);
my $zeiger=\@data;
###### Ausgabe #######
$BalkenD=$graph->plot($zeiger)->png();
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!c:/Perl/bin/perl.exe
use BD2;
use DBI;
@Werte = (
["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
[ 1, 2, 5, 6, 3, 1.5, 1, 3, 4],
[ 10, 12, 5, 9, 1, 2, 1, 7, 8]
);
BD2::uegabe(@Werte);
print "Content-type: image/png\n\n";
binmode STDOUT;
print $BD2::BalkenD;
1
2
3
$data[0][$_]=$Speicher[$_];
$data[1][$_]=$Speicher[$_+6];
$data[2][$_]=$Speicher[$_+12];
$BalkenD=$graph->plot($zeiger)->png();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package BD2;
use warnings;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use GD::Graph::bars;
require Exporter;
@ISA = qw(Exporter);
@EXPORT=qw(generate);
@EXPORT_OK = qw();
$VERSION = '1.00';
sub new
{
#"ObjektName" übernehemen
my $proto = shift;
my $class = $proto;
# Übergebene Argumente
# hier nicht in Gebrauch
my %args = @_;
# Speicher für Variablen
my $self = {};
# Objekt anmelden
bless ($self, $class);
###### Art des Graphen #####
$self->{graph} = new GD::Graph::bars(400, 400);
###### Attribute des Graphen #####
$self->{graph}->set(
x_label => 'Gel-Nr.',
y_label => 'Intensität',
title => 'Dot-Analyse',
y_max_value => 16,
y_tick_number => 8,
y_label_skip => 2,
bar_spacing => 1
);
###### Datensatz ####
$self->{data}=[];
# Objekt zurückliefern
return $self;
}
###### Werte ######
sub generate
{
# $self ist der Variablenspeicher
my ($self,@werte)=@_;
for my $i (0..5)
{
$$self->{data}[0][$i]=$werte[0][$i];
$$self->{data}[1][$i]=$werte[1][$i+6];
$$self->{data}[2][$i]=$werte[2][$i+12];
}
return $self->{graph}->plot($self->{data})->png();
}
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!c:/Perl/bin/perl.exe
use BD2;
use DBI;
my $myBD2=DB2::new();
@Werte = (
["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
[ 1, 2, 5, 6, 3, 1.5, 1, 3, 4],
[ 10, 12, 5, 9, 1, 2, 1, 7, 8]
);
my $png=$myBD2->generate(@Werte);
print "Content-type: image/png\r\n\r\n";
binmode STDOUT;
print $png;
3 Einträge, 1 Seite |