## Strategies for on-the-fly graph generation

Version 2.32

Manual page for Strategies_for_on-the-fly_graph_generation(PL)

On-the-fly graph generation is useful for dynamic content web sites and automatic report generation.`` Ploticus is suitable for these situations since it is a non-interactive command line tool with a relatively small code size.``

Prefabs may be used, or your plots can be script-based. With scripts, variables are often passed in via the command line. It is also possible to have your program build a ploticus script on the fly.``
There are several strategies for producing on-the-fly web graphs:

## Option 1: direct CGI mode

To invoke ploticus in direct cgi mode, you specify a URL that invokes ploticus with the desired parameters, right within an `<img>` tag,

## Option 2: using quisp_pl

A new package called quisp_pl generates web pages dynamically (similarly to php or asp), and ploticus scripts or prefab invocations can be embedded within your code to create dynamic graphs. Download the quisp_pl package and try it.`` One nice thing you can do with this is create CGI form along with the graph, so users can control various graph parameters... here's a live demo example of this.``

## Option 3: via perl or python interface

Perl and python interfaces to `libploticus` have been contributed and are available under "Accessories" on the download page.``

## Option 4: some other CGI interface to the libploticus API

The libploticus API is freely available; developers can write their own interface to it and invoke as a CGI.``

## Option 5: invoking pl via the shell

The performance penalty for going this route may not be as much as you'd expect.`` Generally the procedure is:

  1. generate a unique temp file name for the output
  2. invoke pl via the shell, using the temp file as the output file (-o)
  3. display the temp file using an `<img>` tag
  4. remove the temp file or set up an automatic process to do so. For example, on unix systems you can place the following command into a `crontab` and run it every night to automatically remove files that are over one day old:
  `/usr/bin/find` tmpdir`! -type d -mtime +1 -exec rm -f {} \;
  `

## Option 6: using ploticus CGI via ASP/VBS

This is discussed here: ploticus newsgroup message# 1358

## Troubleshooting tips

In CGI contexts anything written to standard error is unavailable.`` Use the `-diagfile stdout` command line option to see diagnostic messages.`` Version 2.11+ offers the `-echo stdout` command line option which can be used during debugging to display evaluated script lines.``
data display engine
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` August 23, 2005.