And so the inspiration domino effect goes on... :-) The GraphVizPlugin inspired (OK, much more then that) me to create these plugins.

ImageGen is a family of JSPWiki plugins that can generate images from textual representations using different libraries. The image source is plain text stored in the wiki (or generated by another plugin), allowing for collaborative development and easy of change. The image output - a graph, chart or diagram, depending on the plugin - is attached to the wiki page.

Currently the following graphical libraries are supported:

NOTE: This functionality only works with the VersioningFileProvider JSPWiki page provider.

NOTE: All the warnings listed in the Cautions section of GraphVizPlugin also apply to the ImageGen plugins.

Add the plugin call to your wiki page defining a graph or chart. After you save the page, the plugin call will be replaced with the associated image. If you enabled image map creation, clicking on specific areas in the image will get you to corresponding wiki pages.

Note that after making a change to the plugin call (say to change a chart data) you may have to refresh the page to see the new version of the image.

See the specific plugin pages for usage instructions.

In short, those plugins will:

  1. Read the parameters and body of the plugin;
    1. If the source attribute is specified, the attachment data will be read instead of the body;
    2. If the body is used and it contains a nested plugin call, the call is evaluated and its output is substituted in the body of the plugin;
  2. Determine if it is necessary to create a new image
    1. If using an attachment as the data source, a simple version comparison is done;
    2. If using the body, the contents of the attached .dat file are compared against the body data after plugin evaluation. Note that while this will prevent the unnecessary regeneration of the image for changes outside of the plugin body, it will not detect changes in the plugin arguments.
  3. If so, call the associated library or application to generate the image file and (optionally) the image map;
  4. Store the generated image (and image map) as attachments in the target page.
  5. If the body was used, a .dat file is created to hold its contents and is also attached to the target page.
  6. Output the img HTML tag.

All of the steps above with the exception of the actual image generation are implemented by the ImageGeneratorPlugin abstract class. This class is basically a refactoring of the GraphVizPlugin[2] main class that extracts the attachment management engine, parameter processing and HTML generation. It also defines the API used to control the creation of image, image map and data files.

The image generation is delegated to the concrete plugin classes, that interface with a specific graphical application or library.

Run time#

Jar files that implement the graphic libraries used by the ImageGen plugins. You will need to extract some of them from their distribution archives:


NOTE: ImageGen has been tested with JFreeChart 1.0.3 version and it seems to work well.


NOTE: that this is not a Java application, but an executable. After downloading, follow the instructions to install it in your web server machine.
NOTE: You need also to add graphviz.bin to your, pointing to the bin directory of your local GraphViz install.


SnipGraph #

Build time #

To build (using Ant) and test the code from attached source .zip file, you will need the following jar files in addition to the ones listed above.
  • JDK 1.5 or better (ImageGen uses the new Generics feature).
  • JSPWiki.jar (version 2.4.24 or better)
  • easymock.jar

  • Copy to your Wiki WEB-INF/lib directory:
    • the latest ImageGen .jar file (see attachment);
    • the graphical libraries used by the plugins (listed in the Dependencies tab).
  • (Optional) Update the jspwiki.plugin.searchPath in your WEB-INF/ to add the package name of the ImageGen plugins. If you don't do that, you have to prefix the plugin name with its package name when using it in your page.
  • Restart your servlet engine.
  • Fixed bug in GraphVizPlugin - was not taking path names with embedded spaces into accounting when launching the graphviz application.
  • Fixed problems with 2.4.x backward compatibility.
  • Added support for Graphviz applications (previously supported by John Volkar's GraphVizPlugin).
  • Added support for reading the graph data from an attachment.
  • Added support for evaluation of nested plugin invocations. This allows for the dynamic generation of the graph data using plugins like JSPlugin and TasksQuery. Same examples here.
  • Changed logic on how to decide if a new image needs to be generated; now looks at the body content after plugin evaluation.
  • Added *lots* of customization options for the JFreeChart-based plugins.
  • Added support for new JFreeChart charts:
  • Upgraded JFreeChart to version 1.0.1
  • Better documentation of the available parameters for each plugin.
Recents changes (probably 2.3.x) in JSPWiki broke the APIs used by ImageGen. I am working on an update that fix that problem and adds new functionality. Stay tuned!
Added new version of the source zip file. No code changes, just added a missing package and the build.xml file.

Image Gen Plugins Discussion#

TODO Items#

Delete old .imap file attachment when imap=false#

Create a graph with imap=true, the .imap file gets created, subsequently update the graph to imap=false, the .imap file is now a "junk" attachment. It'd be great if it was deleted. -JohnV 15-Mar-2007

Good suggestion. I will look into that. I have been thinking to use the attachment "engine" as a basis for other kinds of transformations too - like spreadsheets (tables), and mind maps (flash or applets). -NascifAbousalhNeto, 16-mar-2007

Support remaining JFreeChart chart types#

The following JFreeChart chart types are not supported by the current version of ImageGen plugins:
  • XYBarChart
  • ~Histogram
  • BoxAndWhiskerChart
  • CandlestickChart
  • HighLowChart
  • SignalChart
  • WaferMapChart
  • WindPlot

SnipGraph Limitations#

  • SnipGraph renderers need to be extended to support image height and width customization;
  • The UMLGraph renderer uses too much memory at runtime;
  • The UMLGraph renderer does not support image maps.

SEQUENCE Customization#

  • The SEQUENCE engine supports some level of customization of the generated diagram, but only through the a Java Preferences file. A small change would allow the customization to be manipulated by plugin parameters.

Help Requests/Comments/Notes...#

Can't make ImageGen plugin work#

1) I have downloaded ImageGenPlugin-20060811.jar from and copied it as "ImageGen.jar" to ../../WEB-INF/lib.

2) I have modified to "jspwiki.plugin.searchPath = org.nascif.jspwiki.plugin.imagegen,com.zanthan.sequence,com.jps.jspwiki.plugin"

3) I have downloaded "" from site and I have extracted "jfreechart-1.0.3.jar" and "jcommon-1.0.6.jar" from "" and copied them into ../../WEB-INF/lib

4) I have downloaded graph-snipsnap.jar and copied graph-snipsnap.jar into ../../WEB-INF/lib

5) I have downloaded sequence.jar from and copied it to ../../WEB-INF/lib

6) I have downloaded graphviz-2.12.tar.gz from and installed it as per installation instruction from

7) I then re-started my servlet engine but everytime I tried to use the horizontal graph plugin, or vertical graph plugin, or barchart plugin or line chart plugin, or sequence plugin, I get an error as follows depending on which one I used:

Plugin insertion failed: Could not find plugin HorizontalGraphPlugin
Plugin insertion failed: Could not find plugin VerticalGraphPlugin
Plugin insertion failed: Could not find plugin BarChartPlugin
Plugin insertion failed: Could not find plugin LineChartPlugin
Plugin insertion failed: Could not find plugin SequencePlugin

Is there something I missed?

I think this is a problem with your searchPath. This is the one I use, note the imageGen package names:
jspwiki.plugin.searchPath = org.nascif.jspwiki.plugin.defects,org.nascif.jspwiki.plugin.imagegen.jfreechart,org.nascif.jspwiki.plugin.imagegen.sequence,

Also, please note that the current supported version for JFreeChart is 1.0.1. Let me know if it works for you with 1.0.3, but you might have API changes related problems. I know, I am due an update for ImageGen for months now... I will try to get around it soon.

Thanks very much for this, Nascif. When I put the new search path, everything worked. It also worked for version 1.0.3 of JFree. Again, many thanks!!
Later note; JFreeChart 1.0.4 also seems to work just fine...

LineChartPlugin or XYLineChartPlugin, How to get markers like used by the ScatterPlotChartPlugin? (Or using ScatterPlotChartPlugin, how to get lines between the markers?)#

It seems like this should be a doable thing; perhaps I'm just being exceptionally dense... All I want are the marker blips to be shown on a line chart... I don't really want to use a scatter-plot... Any Ideas? -JohnV 18-Mar-2007

Hi John,
In ImageGen I tried to surface as many of the JFreeChart arguments I could. I just reflect what you set on the plugin argument list to the corresponding JFreeChart entity (plot, chart, etc.) so your best bet is to check the JFreeChart documentation to see in more detail what the options do and which ones are available (note also that I coded ImageGen against the 1.0.1 version, and the current one, 1.0.4, might have new options). If a desired option is available and setting it doesn't work, it is probably a bug in ImageGen; if it is not available, let me know and I will surface it in a future release.

Back to your problem, I was not able to find an option directly related to making markers in LineChartPlugin; the closest option that I could find were the 'rangecrosshairs' parameters, but I was not able to get them to work - so I added them to my 'bugs to fix' list. On the other hand, I was able to get vertical lines to display on the line chart using the parameters domaingridlinesvisible='true' domaingridlinepaint='black'. I know it is not exactly what you wanted but it allows you to have a better grasp of the value points.

NascifAbousalhNeto - 21-mar-2007

Back to Contributed Plugins

I am unable to download graph-snipsnap.jar. Any working link?

--saro, 03-Sep-2007

so then i.. i am unable to download graph-snipsnap.war... :(

Click the Attach tab, and then click the attachment you want to dowwload.

See here it works. SnipSnap is out of maintenance so I have added the jar here in attachments.

Any reason why this plugins are limited to using only the versioningfileprovider? Any workarounds to make it work with the filesystemprovider?
--Praful, 25 Sep 07

It looks like the 2008 version of ImageGenPlugin.jar isn't the same as the 2005 ImageGenPlugin-src.jar. Is source code available for the latest version of this plugin? If not, would you mind posting it here?


Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
INSTALL.LOG 0.0 kB 3 15-Jun-2006 05:56
INSTALL.LOG.txt 0.0 kB 1 15-Jun-2006 05:55
ImageGenPlugin-20060808.jar 117.5 kB 2 08-Aug-2006 16:42 Nascif Abousalh-Neto
ImageGenPlugin-20060811.jar 117.6 kB 1 11-Aug-2006 23:06 Nascif Abousalh-Neto
ImageGenPlugin-src-20060808.zi... 108.3 kB 2 08-Aug-2006 16:43 Nascif Abousalh-Neto
ImageGenPlugin-src-20060811.zi... 108.3 kB 1 11-Aug-2006 23:06 Nascif Abousalh-Neto
zip 155.0 kB 2 11-Nov-2005 16:49 NascifAbousalhNeto
ImageGenPlugin.jar 118.9 kB 2 31-Dec-2008 12:36 refresh bug fixed
graph-snipsnap.jar 173.5 kB 1 15-Nov-2007 13:52 not mainained any more
« This page (revision-50) was last changed on 03-Apr-2009 04:17 by