Mod phplot
PHPlot is a PHP class for on the fly graphs generation. It was started by Afan Ottenheimer in 1998 as an opensource project, and is now co-developed with Miguel de Benito thanks to sourceforge. It is distributed under the terms of the GNU General Public License, and the PHP license. For further information, please check their website: http://www.phplot.com/
| . | |
Examples from http://www.phplot.com/doc/ |
Install
See Mods Admin for instructions on how to install a Mod.
Usage
Once installed, you will see some new lines under the Wiki "edit > wiki help > Show Plugins Help":
Plots a graph on the data using PHPlot: {PHPLOT(which_data_type=>text-linear|linear-linear|function|linear-linear-error, which_plot_type=>bars|lines|pie|linepoints|points|area)}cells{PHPLOT} - cells separated by ~|~
However, the code itself contains a more detailed description of parameters:
// This plugin plots a graph of the input data using PHPLOT's create_chart.php example script. // // Parameters: // head -- the column header row // // Usage: // The data (and the head paramter) is given one row per line, with columns // separated by ~|~. // // Parameters: // // Mandatory: // XSIZE_in=size x of the graph // YSIZE_in=size y of the graph // which_data_type=text-linear|linear-linear|function|linear-linear-error // datarowM[N]=data on cell[M,N] // which_plot_type=bars|lines|pie|linepoints|points|area // // Optional: // which_dot=diamond|rect|circle|triangle|dot|line|halfline // maxy_in=max height of graph in units of Y axis // miny_in=min height of graph in units of Y axis // ylbl=Y axis label // xlbl=X axis label // title=graph title // which_vti=vertical tick increment // which_hti=horizontal tick increment // which_xap=x axis position // // {PHPLOT( head => header column 1 ~|~ header column 2 ~|~ header column 3 )} // row 1 column 1 ~|~ row 1 column 2 ~|~ row 1 column 3 // row 2 column 1 ~|~ row 2 column 2 ~|~ row 2 column 3 // {PHPLOT}
Example 1: data type text-linear, plot type bars
This code:
{PHPLOT(which_data_type=>text-linear,which_plot_type=>bars, head=>header_column_1~|~header_column_2~|~header_column_3)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>text-linear,which_plot_type=>bars, head=>header_column_1~|~header_column_2~|~header_column_3)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 2: data type text-linear, plot type lines
This code:
{PHPLOT(which_data_type=>text-linear,which_plot_type=>lines, head=>header_column_1~|~header_column_2~|~header_column_3)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>text-linear,which_plot_type=>lines, head=>header_column_1~|~header_column_2~|~header_column_3)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 3: data type linear-linear, plot type lines
This code:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>lines)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>lines)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 4: data type linear-linear, plot type linepoints
This code:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>linepoints)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>linepoints)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 5: : data type text-linear, plot type pie
This code:
{PHPLOT(which_data_type=>text-linear,which_plot_type=>pie)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>text-linear,which_plot_type=>pie)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 6: : data type function, plot type linepoints
This code:
{PHPLOT(which_data_type=>function,which_plot_type=>linepoints)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>function,which_plot_type=>linepoints)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 7: : data type linear-linear, plot type points
This code:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>points)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>points)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
Example 8: : data type linear-linear, plot type area
This code:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>area)} a~|~0~|~0~|~0 b~|~1~|~2~|~3 c~|~5~|~6~|~7 d~|~11~|~12~|~13 e~|~8~|~7~|~6{PHPLOT}
Would produce:
{PHPLOT(which_data_type=>linear-linear,which_plot_type=>area)}
a~|||~0
b~|||~3
c~|||~7
d~|||~13
e~|||~6{PHPLOT}
- PHPlot: http://www.phplot.com/