I am using the TT bindings to GD to create graphs in Bugzilla, with Template Toolkit 2.08c.
I could swear I sent my patch to the list, but it appears not to be in my sent-mail, nor in the list archives, so it must have vanished into the ether. <shrug>
Regardless, here's a patch to the GD::Graph bindings which Does The Right Thing for set_legend. If you need it in some other format, let me know.
Gerv
Index: lib/Template/Plugin/GD/Graph/area.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/area.pm,v
retrieving revision 1.47
diff -u -r1.47 area.pm
--- lib/Template/Plugin/GD/Graph/area.pm 2002/11/04 19:47:37 1.47
+++ lib/Template/Plugin/GD/Graph/area.pm 2003/03/02 13:42:19
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/bars3d.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/bars3d.pm,v
retrieving revision 1.47
diff -u -r1.47 bars3d.pm
--- lib/Template/Plugin/GD/Graph/bars3d.pm 2002/11/04 19:47:38 1.47
+++ lib/Template/Plugin/GD/Graph/bars3d.pm 2003/03/02 13:42:19
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/bars.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/bars.pm,v
retrieving revision 1.47
diff -u -r1.47 bars.pm
--- lib/Template/Plugin/GD/Graph/bars.pm 2002/11/04 19:47:38 1.47
+++ lib/Template/Plugin/GD/Graph/bars.pm 2003/03/02 13:42:19
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/lines3d.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/lines3d.pm,v
retrieving revision 1.47
diff -u -r1.47 lines3d.pm
--- lib/Template/Plugin/GD/Graph/lines3d.pm 2002/11/04 19:47:39 1.47
+++ lib/Template/Plugin/GD/Graph/lines3d.pm 2003/03/02 13:42:19
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/lines.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/lines.pm,v
retrieving revision 1.47
diff -u -r1.47 lines.pm
--- lib/Template/Plugin/GD/Graph/lines.pm 2002/11/04 19:47:39 1.47
+++ lib/Template/Plugin/GD/Graph/lines.pm 2003/03/02 13:42:19
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/linespoints.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/linespoints.pm,v
retrieving revision 1.47
diff -u -r1.47 linespoints.pm
--- lib/Template/Plugin/GD/Graph/linespoints.pm 2002/11/04 19:47:39 1.47
+++ lib/Template/Plugin/GD/Graph/linespoints.pm 2003/03/02 13:42:19
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/mixed.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/mixed.pm,v
retrieving revision 1.47
diff -u -r1.47 mixed.pm
--- lib/Template/Plugin/GD/Graph/mixed.pm 2002/11/04 19:47:39 1.47
+++ lib/Template/Plugin/GD/Graph/mixed.pm 2003/03/02 13:42:20
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
Index: lib/Template/Plugin/GD/Graph/points.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/GD/Graph/points.pm,v
retrieving revision 1.47
diff -u -r1.47 points.pm
--- lib/Template/Plugin/GD/Graph/points.pm 2002/11/04 19:47:40 1.47
+++ lib/Template/Plugin/GD/Graph/points.pm 2003/03/02 13:42:20
@@ -49,6 +49,13 @@
$self->SUPER::set(@_);
}
+sub set_legend
+{
+ my $self = shift;
+
+ $self->SUPER::set_legend(@{$_[0]});
+}
+
1;
__END__
