Loading...
 
Skip to main content

History: Mod phplot

Source of version: 4 (current)

Copy to clipboard
            !!! 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/]

{CENTER()}|| ::{img src=http://www.phplot.com/doc/imgs/graph1.png link="http://www.phplot.com/doc/" desc="Example line graph with labels, legend and left and lower axis titles" width=300 }:: | . |::{img src=http://www.phplot.com/doc/imgs/graph3.png link="http://www.phplot.com/doc/" desc="Example 3d pie chart" width=300 } ::
:: ''Examples from [http://www.phplot.com/doc/]'':: || {CENTER}

!!!! 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": 

{CODE(wrap=>1)}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 ~|~
{CODE}

However, the code itself contains a more detailed description of parameters:
^((help)) needed to identify which parameters are usable^

{CODE()}
// 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}
{CODE}

!!!! Example 1: data type text-linear, plot type bars
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 2: data type text-linear, plot type lines
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 3: data type linear-linear, plot type lines
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 4: data type linear-linear, plot type linepoints
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 5: : data type text-linear, plot type pie
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 6: : data type function, plot type linepoints
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 7: : data type linear-linear, plot type points
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

!!!! Example 8: : data type linear-linear, plot type area
This code:
{CODE(wrap=>1)}
{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} 
{CODE}

Would produce:
{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} 

-=Related pages=-
* ((Mods))
* ((Mods User))
* ((Mods Admin))
* ((Mods Details))
* ((Mods List))

* PHPlot: [http://www.phplot.com/]