Extension:Gchart4mw

From MediaWiki.org

Jump to: navigation, search

     

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
gchart4mw

Release status: beta

Gchart4mw.png
Implementation  Tag
Description provide tags for drawing charts the easy way using google chart API.
License No license specified
Download http://code.google.com/p/gchart4mw

check usage (experimental)

Contents

[edit] What can this extension do?

gchart4mw 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 Google Chart API.

All data for visualization is provided in CSV-style.

[edit] Examples of usage

[edit] pie chart

This example shows the result of 2005´s election for the german Bundestag:

<pie 3d title="Bundestagswahl 2005" size=300x150 xlabel>
SPD,       34.2
CDU,       27.8
CSU,        7.4
GRÜNE,      8.1
FDP,        9.8
Die Linke., 8.7
Sonstige,   3.9
</pie>

Ghart4mw.pie.png

[edit] lines chart

This chart compares the average 24h-temperature of Berlin and Sydney:

<lines size=270x120 title="Avg. Temp (°F)" ymin=0 ymax=80 colors=8AB800,F5B800 xlabel ylabel=4 grid=xy legend>
 ,Berlin,Sydney
J,30.4,71.2
F,33.1,71.6
M,38.3,69.1
A,47.1,64.0
M,56.3,57.2
J,62.6,53.4
J,65.5,51.3
A,64.2,53.4
S,57.7,57.0
O,48.2,62.6
N,39.0,65.8
D,33.8,69.6
</lines>

Gchart4mw.png

See http://code.google.com/p/gchart4mw for details on usage and configuration.

[edit] Download instructions

The most recent version on this extension can be found on the project-page at code.google.com. There is also a SVN-repository available.

[edit] Installation

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

#add configuration parameters here
#setup user rights here
require_once("$IP/extensions/gchart4mw.php");

In addition to this all parameters can be provided with default values to give all charts in a wiki a consistent look. Have a look at http://code.google.com/p/gchart4mw for details.

[edit] See Also

  • gchart4mw tries to use tags which can be read by humans easily. All data is being provided in a readable way. If you prefer to use a template-friendly Google chart API-style calls in your wiki-pages, have a look at Extension:GoogleCharts.