Skip to content

Commit 6dd0c23

Browse files
author
Simon Arlott
committed
Initial commit
0 parents  commit 6dd0c23

File tree

6 files changed

+519
-0
lines changed

6 files changed

+519
-0
lines changed

.htaccess

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
RewriteEngine On
2+
3+
RewriteCond %{REQUEST_URI} ^/[0-9]{4,8}$ [OR]
4+
RewriteCond %{REQUEST_URI} ^/today$
5+
RewriteRule (.*) /index.php?data=$1 [L]
6+
7+
RewriteCond %{REQUEST_URI} ^/graph\.pl [OR]
8+
RewriteCond %{REQUEST_URI} ^/median\.php
9+
RewriteRule .* - [F]

graph.pl

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/perl
2+
use GD::Graph::bars3d;
3+
4+
my $xlabel = shift;
5+
my $ylabel = shift;
6+
$xlabel =~ s/\\(\'|\"|\\)/$1/g;
7+
$ylabel =~ s/\\(\'|\"|\\)/$1/g;
8+
my (@data);
9+
#my (@values);
10+
my $i = 0;
11+
while (my $x = shift) {
12+
my ($l, $u) = split(/,/,$x);
13+
$data[0][$i] = $u;
14+
}
15+
# $values[0][$i] = $u;
16+
$i++;
17+
}
18+
19+
my $graph = GD::Graph::bars3d->new(1000, 400);
20+
$graph->set_text_clr("black");
21+
$graph->set_legend_font(GD::Text::gdTinyFont);
22+
$graph->set(
23+
x_label => $xlabel,
24+
y_label => $ylabel,
25+
bar_spacing => 2,
26+
y_tick_number => 10,
27+
y_label_skip => 1,
28+
# show_values => \@values,
29+
# values_vertical => 1,
30+
# values_space => 10,
31+
# values_format => "%.2f"
32+
);
33+
print $graph->plot(\@data)->png;

0 commit comments

Comments
 (0)