The Ploticus WikiPlugin? passes all its arguments to the ploticus binary and displays the result as PNG, GIF, EPS, SVG, SVGZ or SWF. Ploticus is a free, GPL, non-interactive software package for producing plots, charts, and graphics from data. See http://ploticus.sourceforge.net/doc/welcome.html

Ploticus uses a cache expire date of days.

Usage

  <?plugin Ploticus device||=png [ploticus options...]
     multiline ploticus script ...
  ?>

or without any script: (not tested)

<?plugin Ploticus -prefab vbars
        data=myfile.dat delim=tab y=1
        clickmapurl="http://mywiki.url/wiki/?pagename=@2"
        clickmaplabel="@3" -csmap
?>

TODO: PloticusSql? - create intermediate data from SQL. Similar to SqlResult, just in graphic form. For example to produce nice looking pagehit statistics or ratings statistics. Ploticus has its own sql support within #getproc data, but this would expose security information.

Plugin Arguments

device: gif, png, jpeg, svg, svgz, eps, swf. Any -T parameter supported by ploticus. Default: png
data: optionally add data by <!plugin-list !> pagelist plugins. See Help:WikiPlugin
alt: alt text for the image
-prefab: use the given prefab script (may need PLOTICUS_PREFABS)
-csmap: If a clickable map should be produced (not yet tested) passed to ploticus as -csmap -mapfile $tempfile.map
help: Show a help screen

All other arguments are used as source to ploticus.

Known Problems

  1. For windows you need either a gd library with GIF support or a ploticus with PNG support. This comes only with the cygwin build so far.

Optional Configuration

config.ini
PLOTICUS_EXE = pl.exe (on windows) PLOTICUS_EXE = /usr/local/bin/pl (elsewhere)

prefabs need the environment variable PLOTICUS_PREFABS. Default: /usr/share/ploticus. Maybe also set by the config variable PLOTICUS_PREFABS.

See also WikiPluginCached options in config.ini.

Examples

Plugin Ploticus a échoué. sh: /usr/local/bin/pl: Aucun fichier ou dossier de ce type

The pie chart above was produced by this code from the ploticus testsuite:

<?plugin Ploticus device||=png alt="Sample Pie Chart"
#proc page
#if @DEVICE in gif,png
  scale: 0.7
#endif

//  specify data using {proc getdata}
#proc getdata
data:   Brazil 22
        Columbia 17
        "Costa Rica" 22
        Guatemala 3
        Honduras 12
        Mexico 14
        Nicaragua 28
        Belize 9
        United\nStates 21
        Canada 8

//  render the pie graph using {proc pie}
#proc pie
firstslice: 90
explode: .2 0 0 0 0  .2 0
datafield: 2
labelfield: 1
labelmode: line+label
center: 4 4
radius: 2
colors: yellow pink pink pink pink yellow pink
labelfarout: 1.05
?>

Author

PhpWiki:ReiniUrban

See Also

Help:GraphVizPlugin


PhpWikiDocumentation Help:WikiPlugin

PHP Warning

lib/WikiPluginCached.php (In template 'body' < 'html'):918 Warning[512]: Ploticus error: outputfile '/tmp/PloticusQoSGru.png' not created

Valid XHTML 1.0! Valid CSS!
L'exécution de la page a pris real: 1,543, user: 0,120, sys: 0,020 seconds

Fatal Error:

lib/WikiDB/backend/PearDB.php:1059 Error[256]: wikidb_backend_peardb_mysql: fatal database error



Erreur Fatale de PhpWiki

lib/WikiDB/backend/PearDB.php:1059 Error[256]: wikidb_backend_peardb_mysql: fatal database error


Fatal error: wikidb_backend_peardb_mysql: fatal database error DB Error: insufficient permissions (UPDATE session SET sess_data='wiki_user|O:9:\"_anonuser\":5:{s:7:\"_userid\";s:0:\"\";s:6:\"_level\";i:0;s:6:\"_prefs\";O:15:\"userpreferences\":1:{s:6:\"_prefs\";a:14:{s:6:\"userid\";O:15:\"_userpreference\":1:{s:13:\"default_value\";s:0:\"\";}s:6:\"passwd\";O:15:\"_userpreference\":1:{s:13:\"default_value\";s:0:\"\";}s:9:\"autologin\";O:20:\"_userpreference_bool\":1:{s:13:\"default_value\";b:0;}s:5:\"email\";O:21:\"_userpreference_email\":1:{s:13:\"default_value\";s:0:\"\";}s:11:\"notifyPages\";O:22:\"_userpreference_notify\":1:{s:13:\"default_value\";s:0:\"\";}s:5:\"theme\";O:21:\"_userpreference_theme\":1:{s:13:\"default_value\";s:7:\"smaller\";}s:4:\"lang\";O:24:\"_userpreference_language\":1:{s:13:\"default_value\";s:2:\"fr\";}s:9:\"editWidth\";O:19:\"_userpreference_int\":3:{s:13:\"default_value\";d:80;s:7:\"_minval\";d:30;s:7:\"_maxval\";d:150;}s:11:\"noLinkIcons\";O:20:\"_userpreference_bool\":1:{s:13:\"default_va in /homez.32/autonomie/www/wiki/lib/WikiDB/backend/PearDB.php on line 1059