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 / pie.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-30  |  4.0 KB  |  142 lines

  1. #============================================================= -*-Perl-*-
  2. #
  3. # Template::Plugin::GD::Graph::pie
  4. #
  5. # DESCRIPTION
  6. #
  7. #   Simple Template Toolkit plugin interfacing to the GD::Graph::pie
  8. #   package in the GD::Graph.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: pie.pm,v 1.55 2004/01/13 16:20:56 abw Exp $
  22. #
  23. #============================================================================
  24.  
  25. package Template::Plugin::GD::Graph::pie;
  26.  
  27. require 5.004;
  28.  
  29. use strict;
  30. use GD::Graph::pie;
  31. use Template::Plugin;
  32. use base qw( GD::Graph::pie 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::pie - Create pie charts with legends
  70.  
  71. =head1 SYNOPSIS
  72.  
  73.     [% USE g = GD.Graph.pie(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.pie( 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.pie plugin provides an interface to the GD::Graph::pie
  100. class defined by the GD::Graph module. It allows an (x,y) data set to
  101. be plotted as a pie chart. The x values are typically strings.
  102.  
  103. See L<GD::Graph> for more details.
  104.  
  105. =head1 AUTHOR
  106.  
  107. Craig Barratt E<lt>craig@arraycomm.comE<gt>
  108.  
  109.  
  110. The GD::Graph module was written by Martien Verbruggen.
  111.  
  112.  
  113. =head1 VERSION
  114.  
  115. 1.55, distributed as part of the
  116. Template Toolkit version 2.13, released on 30 January 2004.
  117.  
  118. =head1 COPYRIGHT
  119.  
  120.  
  121. Copyright (C) 2001 Craig Barratt E<lt>craig@arraycomm.comE<gt>
  122.  
  123. GD::Graph is copyright 1999 Martien Verbruggen.
  124.  
  125. This module is free software; you can redistribute it and/or
  126. modify it under the same terms as Perl itself.
  127.  
  128. =head1 SEE ALSO
  129.  
  130. 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::pie3d|Template::Plugin::GD::Graph::pie3d>, L<GD::Graph|GD::Graph>
  131.  
  132. =cut
  133.  
  134. # Local Variables:
  135. # mode: perl
  136. # perl-indent-level: 4
  137. # indent-tabs-mode: nil
  138. # End:
  139. #
  140. # vim: expandtab shiftwidth=4:
  141.