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 / lines3d.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-30  |  4.9 KB  |  167 lines

  1. #============================================================= -*-Perl-*-
  2. #
  3. # Template::Plugin::GD::Graph::lines3d
  4. #
  5. # DESCRIPTION
  6. #
  7. #   Simple Template Toolkit plugin interfacing to the GD::Graph::lines3d
  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: lines3d.pm,v 1.57 2004/01/13 16:20:56 abw Exp $
  22. #
  23. #============================================================================
  24.  
  25. package Template::Plugin::GD::Graph::lines3d;
  26.  
  27. require 5.004;
  28.  
  29. use strict;
  30. use GD::Graph::lines3d;
  31. use Template::Plugin;
  32. use base qw( GD::Graph::lines3d Template::Plugin );
  33. use vars qw( $VERSION );
  34.  
  35. $VERSION = sprintf("%d.%02d", q$Revision: 1.57 $ =~ /(\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.  
  53. sub set_legend
  54. {
  55.     my $self = shift;
  56.     
  57.     $self->SUPER::set_legend(ref $_[0] ? @{$_[0]} : @_);
  58. }
  59.  
  60. 1;
  61.  
  62. __END__
  63.  
  64.  
  65. #------------------------------------------------------------------------
  66. # IMPORTANT NOTE
  67. #   This documentation is generated automatically from source
  68. #   templates.  Any changes you make here may be lost.
  69. #   The 'docsrc' documentation source bundle is available for download
  70. #   from http://www.template-toolkit.org/docs.html and contains all
  71. #   the source templates, XML files, scripts, etc., from which the
  72. #   documentation for the Template Toolkit is built.
  73. #------------------------------------------------------------------------
  74.  
  75. =head1 NAME
  76.  
  77. Template::Plugin::GD::Graph::lines3d - Create 3D line graphs with axes and legends
  78.  
  79. =head1 SYNOPSIS
  80.  
  81.     [% USE g = GD.Graph.lines3d(x_size, y_size); %]
  82.  
  83. =head1 EXAMPLES
  84.  
  85.     [% FILTER null;
  86.         data = [
  87.             ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
  88.                                          "Sep", "Oct", "Nov", "Dec", ],
  89.             [-5, -4, -3, -3, -1,  0,  2,  1,  3,  4,  6,  7],
  90.             [4,   3,  5,  6,  3,1.5, -1, -3, -4, -6, -7, -8],
  91.             [1,   2,  2,  3,  4,  3,  1, -1,  0,  2,  3,  2],
  92.         ];
  93.         
  94.         USE my_graph = GD.Graph.lines3d();
  95.         
  96.         my_graph.set( 
  97.                 x_label => 'Month',
  98.                 y_label => 'Measure of success',
  99.                 title => 'A 3d Line Graph',
  100.  
  101.                 y_max_value => 8,
  102.                 y_min_value => -8,
  103.                 y_tick_number => 16,
  104.                 y_label_skip => 2,
  105.                 box_axis => 0,
  106.                 line_width => 3,
  107.                 zero_axis_only => 1,
  108.                 x_label_position => 1,  
  109.                 y_label_position => 1,  
  110.         
  111.                 x_label_skip => 3,
  112.                 x_tick_offset => 2,
  113.         
  114.                 transparent => 0,
  115.         );      
  116.         my_graph.set_legend("Us", "Them", "Others");
  117.         my_graph.plot(data).png | stdout(1);
  118.        END;
  119.     -%]
  120.  
  121. =head1 DESCRIPTION
  122.  
  123. The GD.Graph.lines3d plugin provides an interface to the GD::Graph::lines3d
  124. class defined by the GD::Graph3d module. It allows one or more (x,y) data
  125. sets to be plotted as y versus x lines with a 3-dimensional appearance,
  126. together with axes and legends.
  127.  
  128. See L<GD::Graph3d> for more details.
  129.  
  130. =head1 AUTHOR
  131.  
  132. Craig Barratt E<lt>craig@arraycomm.comE<gt>
  133.  
  134.  
  135. The GD::Graph3d module was written by Jeremy Wadsack.
  136.  
  137.  
  138. =head1 VERSION
  139.  
  140. 1.57, distributed as part of the
  141. Template Toolkit version 2.13, released on 30 January 2004.
  142.  
  143. =head1 COPYRIGHT
  144.  
  145.  
  146. Copyright (C) 2001 Craig Barratt E<lt>craig@arraycomm.comE<gt>
  147.  
  148. GD::Graph3d is copyright (C) 1999,2000 Wadsack-Allen. All Rights Reserved.
  149.  
  150. This module is free software; you can redistribute it and/or
  151. modify it under the same terms as Perl itself.
  152.  
  153. =head1 SEE ALSO
  154.  
  155. 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::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<Template::Plugin::GD::Graph::pie3d|Template::Plugin::GD::Graph::pie3d>, L<GD::Graph|GD::Graph>, L<GD::Graph3d|GD::Graph3d>
  156.  
  157. =cut
  158.  
  159. # Local Variables:
  160. # mode: perl
  161. # perl-indent-level: 4
  162. # indent-tabs-mode: nil
  163. # End:
  164. #
  165. # vim: expandtab shiftwidth=4:
  166.