Difference between revisions of "Ploticus extension"
(→Examples) |
|||
| Line 9: | Line 9: | ||
Our version of the ''MediaWiki Ploticus Extension'' is contained in the [[Download|Download Archive of DPL]]. | Our version of the ''MediaWiki Ploticus Extension'' is contained in the [[Download|Download Archive of DPL]]. | ||
| − | == Example 1 (static | + | == Example 1 (static version) == |
{| | {| | ||
| Line 45: | Line 45: | ||
"Jim" 23 | "Jim" 23 | ||
"Susan" 123 | "Susan" 123 | ||
| + | |||
| + | // render pie graph | ||
| + | #proc pie | ||
| + | datafield: 2 | ||
| + | labelfmtstring: @@1\n@@2\n@@PCT% | ||
| + | labelmode: line+label | ||
| + | outlinedetails: color=blue | ||
| + | center: 3 3 | ||
| + | radius: 1.1 | ||
| + | colors: dullyellow drabgreen pink powderblue lavender | ||
| + | labelfarout: 1.2 | ||
| + | explode: 0 0.2 0 0 | ||
| + | |||
| + | }} | ||
| + | |} | ||
| + | |||
| + | == Example 2 (dynamic version) == | ||
| + | |||
| + | {| | ||
| + | | | ||
| + | <pre><nowiki> | ||
| + | {{#ploticus: | ||
| + | |||
| + | # get data from DPL query | ||
| + | #proc getdata | ||
| + | data: | ||
| + | {{UsageCount|African Union member states}} | ||
| + | |||
| + | // render pie graph | ||
| + | #proc pie | ||
| + | datafield: 2 | ||
| + | labelfmtstring: @@1\n@@2\n@@PCT% | ||
| + | labelmode: line+label | ||
| + | center: 3 3 | ||
| + | radius: 1.1 | ||
| + | colors: dullyellow drabgreen pink | ||
| + | labelfarout: 1.2 | ||
| + | explode: 0 0.2 0 0 | ||
| + | |||
| + | }} | ||
| + | </nowiki></pre> | ||
| + | | | ||
| + | {{#ploticus: | ||
| + | |||
| + | # get data from DPL query | ||
| + | #proc getdata | ||
| + | data: | ||
| + | {{UsageCount|African Union member states}} | ||
// render pie graph | // render pie graph | ||
Revision as of 09:37, 20 August 2012
Contents
Ploticus Tool
PLOTICUS is a free softwarere package for creating plots and charts.
Ploticus Extension
The Mediawiki Extension:Ploticus allows to embed Ploticus into a Mediawiki installation. When using the Ploticus Extension you have to deliver a script which contains the data on which the chart shall be based.
This is where DPL comes into the game: DPL can be used to extract that data from information contained in the articles of your wiki. For that purpose we made a small modification to the Ploticus Extension: Our modified version can take data not only from a hand-written script but also from the output of a DPL script.
Our version of the MediaWiki Ploticus Extension is contained in the Download Archive of DPL.
Example 1 (static version)
{{#ploticus:
# get data from DPL query
#proc getdata
data:
"Jack" 151
"Jim" 23
"Susan" 123
// render pie graph
#proc pie
datafield: 2
labelfmtstring: @@1\n@@2\n@@PCT%
labelmode: line+label
center: 3 3
radius: 1.1
colors: dullyellow drabgreen pink
labelfarout: 1.2
explode: 0 0.2 0 0
}}
|
{{#ploticus:
data: "Jack" 151 "Jim" 23 "Susan" 123 // render pie graph
datafield: 2 labelfmtstring: @@1\n@@2\n@@PCT% labelmode: line+label outlinedetails: color=blue center: 3 3 radius: 1.1 colors: dullyellow drabgreen pink powderblue lavender labelfarout: 1.2 explode: 0 0.2 0 0 }} |
Example 2 (dynamic version)
{{#ploticus:
# get data from DPL query
#proc getdata
data:
{{UsageCount|African Union member states}}
// render pie graph
#proc pie
datafield: 2
labelfmtstring: @@1\n@@2\n@@PCT%
labelmode: line+label
center: 3 3
radius: 1.1
colors: dullyellow drabgreen pink
labelfarout: 1.2
explode: 0 0.2 0 0
}}
|
{{#ploticus:
data: category = African Union member states"Cameroon" %COUNT% "Nigeria" %COUNT% "Somalia" %COUNT% "Sudan" %COUNT%
datafield: 2 labelfmtstring: @@1\n@@2\n@@PCT% labelmode: line+label outlinedetails: color=blue center: 3 3 radius: 1.1 colors: dullyellow drabgreen pink powderblue lavender labelfarout: 1.2 explode: 0 0.2 0 0 }} |