Extension:Jpgraphmw

What can this extension do?
JpgraphMW is a mediawiki-extension for visualizing data in wiki pages. To do so it provides a couple of additional tags for embedding different chart-types. Possible charts are
 * lines
 * bars
 * and pie-charts

The charts are drawn by using the Jpgraph Chart API.

All data for visualization is provided in CSV-style.

Simple multiline chart
Following code ...

... will produce the graphic bellow:



Multiline stacked chart with time as x value
Following exemple ...

... will produce the following graphic :



Simple 3d pie chart
Here's another exemple:



Download instructions
This project is housed at google code web site :. To install this extension, retrieve jpgraphmw.php and put it into your extensions directory. You will also need to download a fresh copy of jpgraph library. Create a sub directory named jpgraph in extensions directory and extract the contains into it :

root@host:/var/www/wiki/extensions# mkdir jpgraph root@host:/var/www/wiki/extensions# cd jpgraph/ root@host:/var/www/wiki/extensions/jpgraph# tar xfvj /path/to/your/tar/jpgraph-3.0.5.tar.bz2

nb: If you use a fresh version of Linux, you may experience ttf problem concerning ttf path. To fix this issue, edit jpg-config.inc.php in jpgraph directory and add the following line :

Check that the ttf directory is correct :

root@host:/var/www/wiki/extensions/jpgraph/src# grep TTF_DIR jpg-config.inc.php // TTF_DIR: //  TTF_DIR   /usr/share/fonts/truetype/ //  MBTTF_DIR /usr/share/fonts/truetype/ //  TTF_DIR   $SERVER_SYSTEMROOT/fonts/ //  MBTTF_DIR $SERVER_SYSTEMROOT/fonts/ // define('TTF_DIR','/usr/share/fonts/truetype/'); // define('MBTTF_DIR','/usr/share/fonts/truetype/'); define('TTF_DIR','/usr/share/fonts/truetype/ttf-dejavu/');

Installation
To install this extension, add the following to LocalSettings.php:

Configuration parameters
Depending to your php installation, you may want to disable part of the possibility of jpgraph like antialias and ttf rendering. You can do that by setting values for $jpgraphWikiDefaults or $jpgraph(Lines|Bar|Pie)Defaults variables :

$jpgraphWikiDefaults = Array ("size" => "200x120", "antialias" => "no", "usettf" => "no", "font" => "DV_SansSerif");