Help:Extension/CreateGraph
From Metabolomics.JP
(Difference between revisions)
Line 2: | Line 2: | ||
|author=K, Suwa | |author=K, Suwa | ||
|version=0.1 | |version=0.1 | ||
+ | |type=Parser function, XML markup | ||
}} | }} | ||
Line 7: | Line 8: | ||
Extension to display graphs by using jpgraph. | Extension to display graphs by using jpgraph. | ||
+ | |||
+ | == Example == | ||
+ | === <nowiki>{{#graph:グラフの種類|size=サイズ;title=タイトル;legend=凡例位置;label=ラベル;data1=データ}}</nowiki> === | ||
+ | ==== 折れ線グラフ ==== | ||
+ | * ソース | ||
+ | <nowiki>{{#graph:line|size=300x300;title=test;legend=0x0;label=a;data1=10,34,20,10,33,23,40;data2=5,2,10,23,21,8,1}}</nowiki> | ||
+ | |||
+ | * 実行例 | ||
+ | {{#graph:line|size=300x300;title=test;legend=0x0;label=a;data1=10,34,20,10,33,23,40;data2=5,2,10,23,21,8,1}} | ||
+ | |||
+ | |||
+ | ==== 縦棒グラフ ==== | ||
+ | * ソース | ||
+ | <nowiki>{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}</nowiki> | ||
+ | |||
+ | * 実行例 | ||
+ | {{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}} | ||
+ | |||
+ | |||
+ | ==== 横棒グラフ ==== | ||
+ | * ソース | ||
+ | <nowiki>{{#graph:hbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}</nowiki> | ||
+ | |||
+ | * 実行例 | ||
+ | {{#graph:hbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}} | ||
+ | |||
+ | |||
+ | ==== 円グラフ ==== | ||
+ | * ソース | ||
+ | <nowiki>{{#graph:pie|size=300x300;title=test;legend=0x0;label=;a=10,b=34,c=20,d=10,e=33,f=23,g=40}}</nowiki> | ||
+ | |||
+ | * 実行例 | ||
+ | {{#graph:pie|size=300x300;title=test;legend=0x0;label=;a=10;b=34;c=20;d=10;e=33;f=23;g=40}} | ||
+ | |||
+ | |||
+ | ==== 3D円グラフ ==== | ||
+ | * ソース | ||
+ | <nowiki>{{#graph:pie3|size=300x300;title=test;legend=0x0;label=;a=10,b=34,c=20,d=10,e=33,f=23,g=40}}</nowiki> | ||
+ | |||
+ | * 実行例 | ||
+ | {{#graph:pie3|size=300x300;title=test;legend=0x0;label=;a=10;b=34;c=20;d=10;e=33;f=23;g=40}} | ||
== Requirements == | == Requirements == |
Revision as of 14:48, 1 March 2011
Extension Information | |
Implementation | |
Description | |
Author(s) | K, Suwa |
Version | 0.1 |
MediaWiki | |
License | |
Hooks used | |
Token type | Parser function, XML markup |
Contents |
Extension to display graphs by using jpgraph.
Example
{{#graph:グラフの種類|size=サイズ;title=タイトル;legend=凡例位置;label=ラベル;data1=データ}}
折れ線グラフ
- ソース
{{#graph:line|size=300x300;title=test;legend=0x0;label=a;data1=10,34,20,10,33,23,40;data2=5,2,10,23,21,8,1}}
- 実行例
縦棒グラフ
- ソース
{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}
- 実行例
横棒グラフ
- ソース
{{#graph:hbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}
- 実行例
円グラフ
- ソース
{{#graph:pie|size=300x300;title=test;legend=0x0;label=;a=10,b=34,c=20,d=10,e=33,f=23,g=40}}
- 実行例
3D円グラフ
- ソース
{{#graph:pie3|size=300x300;title=test;legend=0x0;label=;a=10,b=34,c=20,d=10,e=33,f=23,g=40}}
- 実行例
Requirements
Download
version | source | md5 | OperationCheck version |
0.2(October 23,2008) | CreateGraph.phps | ca648eadeb95cb99151cf24cecfcd3ba | 1.11.1, 1.16.2 |
version | source | md5 |
0.1(September 17,2008) | graph.phps | f43944b3a54577a793edf379ba0ff2a9 |
version | source | md5 |
0.1(September 17,2008) | graph_inc.phps | 1325096054243aa333a98033c4d35c18 |
Installtion
- Install jpgraph.
- Download CreateGraph.phps and rename it to CreateGraph.php.
- Place it in the extensions/ directory.
- Download graph.phps and graph_inc.phps, rename them to graph.php and graph.inc.
- Place them in any directory (the same place under DocumentRoot).
- Insert the follow lines to LocalSettings.php
require_once( "$IP/extensions/CreateGraph.php" ); $egScriptPath = "path to directory which in graph.php from DocumentRoot"; // ex. "/mediawiki/scripts"
- set $jpgraph variable in graph.inc
$jpgraph = "path to jpgraph"; // ex. "/var/www/htdocs/mediawiki/scripts/jpgraph