Help:Extension/CreateGraph
From Metabolomics.JP
(Difference between revisions)
(10 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
{{Extension | {{Extension | ||
|author=K, Suwa | |author=K, Suwa | ||
− | |version=0. | + | |version=0.2 |
− | | | + | |type=Parser function, XML markup |
}} | }} | ||
Line 8: | 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,b,c,d,e,f,g,h;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,b,c,d,e,f,g,h;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 == | ||
− | [http://www.asial.co.jp/jpgraph/ jpgraph] | + | * [http://www.asial.co.jp/jpgraph/ jpgraph] |
== Download == | == Download == | ||
<table border="1" cellpadding="3" cellspacing="1"> | <table border="1" cellpadding="3" cellspacing="1"> | ||
− | <tr><td>version</td><td>source</td><td> | + | <tr><td>version</td><td>source</td><td>md5</td><td>OperationCheck version</td></tr> |
− | <tr><td>0. | + | <tr><td>0.2(October 23,2008)</td><td>{{#ifexistfile:/data/src/CreateGraph/CreateGraph.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">ca648eadeb95cb99151cf24cecfcd3ba</pre></td><td>1.11.1, 1.16.2</td></tr> |
</table> | </table> | ||
<table border="1" cellpadding="3" cellspacing="1"> | <table border="1" cellpadding="3" cellspacing="1"> | ||
− | <tr><td>version</td><td>source</td><td> | + | <tr><td>version</td><td>source</td><td>md5</td></tr> |
− | <tr><td>0.1(September | + | <tr><td>0.2(March 1,2011)</td><td>{{#ifexistfile:/data/src/CreateGraph/graph.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">c6b8d0d7b8172395998a291258646242</pre></td></tr> |
+ | <tr><td>0.1(September 17,2008)</td><td>{{#ifexistfile:/data/src/CreateGraph/previous/graph-0.1.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">f43944b3a54577a793edf379ba0ff2a9</pre></td></tr> | ||
</table> | </table> | ||
<table border="1" cellpadding="3" cellspacing="1"> | <table border="1" cellpadding="3" cellspacing="1"> | ||
− | <tr><td>version</td><td>source</td><td> | + | <tr><td>version</td><td>source</td><td>md5</td></tr> |
− | <tr><td>0.1(September | + | <tr><td>0.1(September 17,2008)</td><td>{{#ifexistfile:/data/src/CreateGraph/graph_inc.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">1325096054243aa333a98033c4d35c18</pre></td></tr> |
</table> | </table> | ||
== Installtion == | == Installtion == | ||
<ol> | <ol> | ||
− | <li>Download CreateGraph.phps and rename to CreateGraph.php.</li> | + | <li>Install jpgraph.</li> |
− | <li> | + | <li>Download CreateGraph.phps and rename it to CreateGraph.php.</li> |
− | <li>Download graph.phps and graph_inc.phps, rename to graph.php and graph.inc.</li> | + | <li>Place it in the extensions/ directory.</li> |
− | <li> | + | <li>Download graph.phps and graph_inc.phps, rename them to graph.php and graph.inc.</li> |
− | <li>Insert follow | + | <li>Place them in any directory (the same place under DocumentRoot).</li> |
+ | <li>Insert the follow lines to LocalSettings.php | ||
<pre>require_once( "$IP/extensions/CreateGraph.php" ); | <pre>require_once( "$IP/extensions/CreateGraph.php" ); | ||
− | $egScriptPath = "path to directory which in graph.php from DocumentRoot";</pre></li> | + | $egScriptPath = "path to directory which in graph.php from DocumentRoot"; // ex. "/mediawiki/scripts"</pre></li> |
− | <li> | + | <li>set $jpgraph variable in graph.inc |
− | <pre>$jpgraph = "path to jpgraph";</pre></li> | + | <pre>$jpgraph = "path to jpgraph"; // ex. "/var/www/htdocs/mediawiki/scripts/jpgraph</pre></li> |
</ol> | </ol> | ||
== Function == | == Function == | ||
# [[Help:Extensions#.7B.7B.23graph:type.7Csize.3D.5BWidth.5Dx.5BHheight.5D.3Btitle.3D.5Btitle.5D.3Blegend.3D.5BLeft.5Dx.5BTop.5D.3Blabel.3D.5Blabel1.5D.2C.5Blabel2.5D.2C....3B.5Bdata1.5D.3D.5Bn1-1.5D.2C.5Bn1-2.5D.2C....3B.5Bdata2.5D.3D.5Bn2-1.5D.2C.5Bn2-2.5D.2C....3B....7D.7D|graph]] | # [[Help:Extensions#.7B.7B.23graph:type.7Csize.3D.5BWidth.5Dx.5BHheight.5D.3Btitle.3D.5Btitle.5D.3Blegend.3D.5BLeft.5Dx.5BTop.5D.3Blabel.3D.5Blabel1.5D.2C.5Blabel2.5D.2C....3B.5Bdata1.5D.3D.5Bn1-1.5D.2C.5Bn1-2.5D.2C....3B.5Bdata2.5D.3D.5Bn2-1.5D.2C.5Bn2-2.5D.2C....3B....7D.7D|graph]] | ||
+ | |||
+ | == Changes == | ||
+ | === graph.php === | ||
+ | 0.2 | ||
+ | * バグ修正 | ||
+ | * マージンを指定できるようになりました。 |
Latest revision as of 09:09, 8 January 2014
Extension Information | |
Implementation | |
Description | |
Author(s) | K, Suwa |
Version | 0.2 |
MediaWiki | |
License | |
Hooks used | |
Token type | Parser function, XML markup |
Contents |
Extension to display graphs by using jpgraph.
[edit] Example
[edit] {{#graph:グラフの種類|size=サイズ;title=タイトル;legend=凡例位置;label=ラベル;data1=データ}}
[edit] 折れ線グラフ
- ソース
{{#graph:line|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g,h;data1=10,34,20,10,33,23,40;data2=5,2,10,23,21,8,1}}
- 実行例
[edit] 縦棒グラフ
- ソース
{{#graph:vbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}
- 実行例
[edit] 横棒グラフ
- ソース
{{#graph:hbar|size=300x300;title=test;legend=0x0;label=a,b,c,d,e,f,g;data1=10,34,20,10,33,23,40}}
- 実行例
[edit] 円グラフ
- ソース
{{#graph:pie|size=300x300;title=test;legend=0x0;label=;a=10;b=34;c=20;d=10;e=33;f=23;g=40}}
- 実行例
[edit] 3D円グラフ
- ソース
{{#graph:pie3|size=300x300;title=test;legend=0x0;label=;a=10;b=34;c=20;d=10;e=33;f=23;g=40}}
- 実行例
[edit] Requirements
[edit] Download
version | source | md5 | OperationCheck version |
0.2(October 23,2008) | CreateGraph.phps | ca648eadeb95cb99151cf24cecfcd3ba | 1.11.1, 1.16.2 |
version | source | md5 |
0.2(March 1,2011) | graph.phps | c6b8d0d7b8172395998a291258646242 |
0.1(September 17,2008) | graph-0.1.phps | f43944b3a54577a793edf379ba0ff2a9 |
version | source | md5 |
0.1(September 17,2008) | graph_inc.phps | 1325096054243aa333a98033c4d35c18 |
[edit] 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
[edit] Function
[edit] Changes
[edit] graph.php
0.2
- バグ修正
- マージンを指定できるようになりました。