Templat...ph::area(3)

πŸ’… NAME

Template::Plugin::GD::Graph::area β€” ok so this is the plugin that makes area graphs with axes and legends, bestie. Like line graphs but with the space under the line all shaded in. Iconic behavior honestly πŸŽ€


✨ SYNOPSIS ✨

[% USE g = GD.Graph.area(x_size, y_size); %]

That's it. That's the whole vibe. You USE it, you give it a size, you go off πŸ‘‘


🌸 EXAMPLES 🌸

Here's the full glow-up, copied exactly so nothing goes sideways:

[% FILTER null;
    data = [
        ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
        [    5,   12,   24,   33,   19,    8,    6,    15,    21],
        [   -1,   -2,   -5,   -6,   -3,  1.5,    1,   1.3,     2]
    ];

    USE my_graph = GD.Graph.area();
    my_graph.set(
            two_axes => 1,
            zero_axis => 1,
            transparent => 0,
    );
    my_graph.set_legend('left axis', 'right axis' );
    my_graph.plot(data).png | stdout(1);
   END;
-%]

Not me staring at this like it's a work of art 😭 Two data sets, two axes, legends on the left and right β€” she's serving main character energy fr fr.


πŸ¦‹ DESCRIPTION πŸ¦‹

So the GD.Graph.area plugin is basically a little bridge πŸŒ‰ β€” it gives you an interface to the GD::Graph::area class, which lives over in the GD::Graph module.

What it does: it lets you plot one or more (x,y) data sets as lines, and it shades the area between the line and the x-axis. Chef's kiss. On top of all that you also get axes and legends, because presentation matters πŸ’…

Want the full tea? Go read GD::Graph for more details.

🫢 AUTHOR 🫢

Let's give credit where credit is due, because these people literally built the thing:

  • Thomas Boutell wrote the GD graphics library.
  • Lincoln D. Stein wrote the Perl GD modules that interface to it.
  • Martien Verbruggen wrote the GD::Graph module.
  • Craig Barratt <craig@arraycomm.com> wrote the original GD plugins for the Template Toolkit (2001).
  • Andy Wardley <abw@cpan.org> extracted them from the TT core into a separate distribution for TT version 2.15.

Legends only πŸ‘‘βœ¨


Copyright (C) 2001 Craig Barratt <craig@arraycomm.com>, 2006 Andy Wardley <abw@cpan.org>.

GD::Graph is copyright 1999 Martien Verbruggen.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

🫢 Free software bestie β€” same terms as Perl itself, no cap.

🌈 SEE ALSO 🌈

Go check out her whole friend group:

  • Template::Plugin::GD
  • Template::Plugin::GD::Graph::lines
  • Template::Plugin::GD::Graph::lines3d
  • Template::Plugin::GD::Graph::bars
  • Template::Plugin::GD::Graph::bars3d
  • Template::Plugin::GD::Graph::points
  • Template::Plugin::GD::Graph::linespoints
  • Template::Plugin::GD::Graph::mixed
  • Template::Plugin::GD::Graph::pie
  • Template::Plugin::GD::Graph::pie3d
  • GD

Okay that's the whole page, hope it slayed for you πŸ§šβ€β™€οΈβœ¨ This one's from perl v5.42.0, dated 2017-10-08, and it lives at Templat...ph::area(3) in the User Contributed Perl Documentation β€” mwah, go plot something pretty πŸ’œπŸŽ€

πŸ“¦ where this page comes from