use GD::Graph::sparklines;

      my $graph = GD::Graph::sparklines->new(100, 30);
      my $gd = $graph->plot( [[0,1,2,3], [16, 40, 35, 20]] );
      print $gd->png();

    GD::Graph::sparklines is a Perl module for creating sparklines using the
    GD::Graph infrastructure -- if you want a sparkline of your data, you
    can just replace

      use GD::Graph::lines;


      use GD::Graph::sparklines;

    and it will "just work", assuming you've not used any esoteric options.

    GD::Graph::sparklines was originally a simple wrapper around
    GD::Graph::lines but it turned out very difficult to get the graph
    sizing correct without subclassing and overriding methods.

    (It's also very difficult to get ploticus to draw sparklines.)

    GD::Graph::sparklines adds a few options to the GD::Graph set.

  y_min_clip, y_max_clip
    If set, clips the graph to those values (overriding any minimum or
    maximum values in the data sets).

  y_band_min, y_band_max
    If set, plots a background "range" band between the two values.

    If set, doesn't draw the little red indicator blob on the last value.

    Undoubtedly lots. In particular, the full power of GD::Graph isn't
    implemented and will probably go terribly wrong if attempted.

    There's no way of setting the colour of the background band or avoiding
    the light grey as first colour. This should probably be an option,
    traditional, which sets the grey colours, draws the blob, etc.

    The graphs are generally ugly -- I tend to render them at 4x and use "|
    convert -scale 25%" to generate the final smoothed output. (GD's
    copyResampled method doesn't seem to work very well otherwise there'd be
    a resample option for generating anti-aliased graphs.)

    Edward Tufte for his chapter about sparklines in "Beautiful Evidence"
    Martien Verbruggen for GD::Graph

    Copyright (c) 2004, Rob Partington <>