Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    SVGGraph 0.07

    Download button

    No screenshots available
    Downloads: 321  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Teun van Eijsden | More programs
    Perl Artistic License / FREE
    July 26th, 2007, 10:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    SVGGraph description

    SVGGraph is a Perl extension for creating SVG Graphs / Diagrams / Charts / Plots.

    SVGGraph is a Perl extension for creating SVG Graphs / Diagrams / Charts / Plots.

    SYNOPSIS

    use SVGGraph;

    my @a = (1, 2, 3, 4);
    my @b = (3, 4, 3.5, 6.33);

    print "Content-type: image/svg-xmlnn";
    my $SVGGraph = new SVGGraph;
    print SVGGraph->CreateGraph(
    {'title' => 'Financial Results Q1 2002'},
    [@a, @b, 'Staplers', 'red']
    );

    This module converts sets of arrays with coordinates into graphs, much like GNUplot would. It creates the graphs in the SVG (Scalable Vector Graphics) format. It has two styles, verticalbars and spline. It is designed to be light-weight.

    If your internet browser cannot display SVG, try downloading a plugin at adobe.com.

    EXAMPLES

    For examples see: http://pearlshed.nl/svggraph/1.png and http://pearlshed.nl/svggraph/2.png

    Long code example:

    #!/usr/bin/perl -w -I.

    use strict;
    use SVGGraph;

    ### Array with x-values
    my @a = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
    ### Arrays with y-values
    my @b = (-5, 2, 1, 5, 8, 8, 9, 5, 4, 10, 2, 1, 5, 8, 8, 9, 5, 4, 10, 5);
    my @c = (6, -4, 2, 1, 5, 8, 8, 9, 5, 4, 10, 2, 1, 5, 8, 8, 9, 5, 4, 10);
    my @d = (1, 2, 3, 4, 9, 8, 7, 6, 5, 12, 30, 23, 12, 17, 13, 23, 12, 10, 20, 11);
    my @e = (3, 1, 2, -3, -4, -9, -8, -7, 6, 5, 12, 30, 23, 12, 17, 13, 23, 12, 10, 20);

    ### Initialise
    my $SVGGraph = new SVGGraph;
    ### Print the elusive content-type so the browser knows what mime type to expect
    print "Content-type: image/svg-xmlnn";
    ### Print the graph
    print $SVGGraph->CreateGraph( {
    'graphtype' => 'verticalbars', ### verticalbars or spline
    'imageheight' => 300, ### The total height of the whole svg image
    'barwidth' => 8, ### Width of the bar or dot in pixels
    'horiunitdistance' => 20, ### This is the distance in pixels between 1 x-unit
    'title' => 'Financial Results Q1 2002',
    'titlestyle' => 'font-size:24;fill:#FF0000;',
    'xlabel' => 'Week',
    'xlabelstyle' => 'font-size:16;fill:darkblue',
    'ylabel' => 'Revenue (x1000 USD)',
    'ylabelstyle' => 'font-size:16;fill:brown',
    'legendoffset' => '10, 10' ### In pixels from top left corner
    },
    [@a, @b, 'Bananas', '#FF0000'],
    [@a, @c, 'Apples', '#006699'],
    [@a, @d, 'Strawberries', '#FF9933'],
    [@a, @e, 'Melons', 'green']
    );

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    create SVG Graphs | create SVG Diagrams | create SVG Charts | SVGGraph | SVG | Graphs

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM