home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / pie3d.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-30  |  4.3 KB  |  146 lines

  1. #============================================================= -*-Perl-*-
  2. #
  3. # Template::Plugin::GD::Graph::pie3d
  4. #
  5. # DESCRIPTION
  6. #
  7. #   Simple Template Toolkit plugin interfacing to the GD::Graph::pie3d
  8. #   package in the GD::Graph3D.pm module.
  9. #
  10. # AUTHOR
  11. #   Craig Barratt   <craig@arraycomm.com>
  12. #
  13. # COPYRIGHT
  14. #   Copyright (C) 2001 Craig Barratt.  All Rights Reserved.
  15. #
  16. #   This module is free software; you can redistribute it and/or
  17. #   modify it under the same terms as Perl itself.
  18. #
  19. #----------------------------------------------------------------------------
  20. #
  21. # $Id: pie3d.pm,v 1.55 2004/01/13 16:20:56 abw Exp $
  22. #
  23. #============================================================================
  24.  
  25. package Template::Plugin::GD::Graph::pie3d;
  26.  
  27. require 5.004;
  28.  
  29. use strict;
  30. use GD::Graph::pie3d;
  31. use Template::Plugin;
  32. use base qw( GD::Graph::pie3d Template::Plugin );
  33. use vars qw( $VERSION );
  34.  
  35. $VERSION = sprintf("%d.%02d", q$Revision: 1.55 $ =~ /(\d+)\.(\d+)/);
  36.  
  37. sub new
  38. {
  39.     my $class   = shift;
  40.     my $context = shift;
  41.     return $class->SUPER::new(@_);
  42. }
  43.  
  44. sub set
  45. {
  46.     my $self = shift;
  47.  
  48.     push(@_, %{pop(@_)}) if ( @_ & 1 && ref($_[@_-1]) eq "HASH" );
  49.     $self->SUPER::set(@_);
  50. }
  51.  
  52. 1;
  53.  
  54. __END__
  55.  
  56.  
  57. #------------------------------------------------------------------------
  58. # IMPORTANT NOTE
  59. #   This documentation is generated automatically from source
  60. #   templates.  Any changes you make here may be lost.
  61. #   The 'docsrc' documentation source bundle is available for download
  62. #   from http://www.template-toolkit.org/docs.html and contains all
  63. #   the source templates, XML files, scripts, etc., from which the
  64. #   documentation for the Template Toolkit is built.
  65. #------------------------------------------------------------------------
  66.  
  67. =head1 NAME
  68.  
  69. Template::Plugin::GD::Graph::pie3d - Create 3D pie charts with legends
  70.  
  71. =head1 SYNOPSIS
  72.  
  73.     [% USE g = GD.Graph.pie3d(x_size, y_size); %]
  74.  
  75. =head1 EXAMPLES
  76.  
  77.     [% FILTER null;
  78.         data = [
  79.             ["1st","2nd","3rd","4th","5th","6th"],
  80.             [    4,    2,    3,    4,    3,  3.5]
  81.         ];
  82.  
  83.         USE my_graph = GD.Graph.pie3d( 250, 200 );
  84.  
  85.         my_graph.set(
  86.                 title => 'A Pie Chart',
  87.                 label => 'Label',
  88.                 axislabelclr => 'black',
  89.                 pie_height => 36,
  90.  
  91.                 transparent => 0,
  92.         );
  93.         my_graph.plot(data).png | stdout(1);
  94.        END;
  95.     -%]
  96.  
  97. =head1 DESCRIPTION
  98.  
  99. The GD.Graph.pie3d plugin provides an interface to the GD::Graph::pie3d
  100. class defined by the GD::Graph module. It allows an (x,y) data set to
  101. be plotted as a 3d pie chart.  The x values are typically strings.
  102.  
  103. Note that GD::Graph::pie already produces a 3d effect, so GD::Graph::pie3d
  104. is just a wrapper around GD::Graph::pie.  Similarly, the plugin
  105. GD.Graph.pie3d is effectively the same as the plugin GD.Graph.pie.
  106.  
  107. See L<GD::Graph3d> for more details.
  108.  
  109. =head1 AUTHOR
  110.  
  111. Craig Barratt E<lt>craig@arraycomm.comE<gt>
  112.  
  113.  
  114. The GD::Graph3d module was written by Jeremy Wadsack. The GD::Graph module was written by Martien Verbruggen.
  115.  
  116.  
  117. =head1 VERSION
  118.  
  119. 1.55, distributed as part of the
  120. Template Toolkit version 2.13, released on 30 January 2004.
  121.  
  122. =head1 COPYRIGHT
  123.  
  124.  
  125. Copyright (C) 2001 Craig Barratt E<lt>craig@arraycomm.comE<gt>
  126.  
  127. GD::Graph3d is copyright (c) 1999,2000 Wadsack-Allen. All Rights Reserved. GD::Graph is copyright 1999 Martien Verbruggen.
  128.  
  129. This module is free software; you can redistribute it and/or
  130. modify it under the same terms as Perl itself.
  131.  
  132. =head1 SEE ALSO
  133.  
  134. L<Template::Plugin|Template::Plugin>, L<Template::Plugin::GD|Template::Plugin::GD>, L<Template::Plugin::GD::Graph::lines|Template::Plugin::GD::Graph::lines>, L<Template::Plugin::GD::Graph::lines3d|Template::Plugin::GD::Graph::lines3d>, L<Template::Plugin::GD::Graph::bars|Template::Plugin::GD::Graph::bars>, L<Template::Plugin::GD::Graph::bars3d|Template::Plugin::GD::Graph::bars3d>, L<Template::Plugin::GD::Graph::points|Template::Plugin::GD::Graph::points>, L<Template::Plugin::GD::Graph::linespoints|Template::Plugin::GD::Graph::linespoints>, L<Template::Plugin::GD::Graph::area|Template::Plugin::GD::Graph::area>, L<Template::Plugin::GD::Graph::mixed|Template::Plugin::GD::Graph::mixed>, L<Template::Plugin::GD::Graph::pie|Template::Plugin::GD::Graph::pie>, L<GD::Graph|GD::Graph>, L<GD::Graph3d|GD::Graph3d>
  135.  
  136. =cut
  137.  
  138. # Local Variables:
  139. # mode: perl
  140. # perl-indent-level: 4
  141. # indent-tabs-mode: nil
  142. # End:
  143. #
  144. # vim: expandtab shiftwidth=4:
  145.