Main menu:
Development > Php
OBJECTIVES
This package is intended to build charts "on the fly" from a mySQL database,it can handle currently bar, stacked bar, line and pie charts, and the presence of subcharts connect by arbitrary keys
Below you can find some example of how it works and what it can create (click on the images to enlarge):
SETUP
Download it here http://www.kendar.org/files/graza.1_0.zip
All the configuration that should be d one is into the includes/settings.inc.php Here there are the db connection strings, and the location for the ttf font to use, you need so the GD library of PHP and the library that allow the use of True Type Font. In the package inside the fonts directory there is a ready to use file. You should run the script/service_table.sql on your mySQL database to create the chart storage table
STANDARD USAGE
Chart Types:
bars, stacked-bars, pie, line. All can be in reversed form (y*x)
Create a new chart:
Create a subquery:
Supposed that you have to link to tables in a one-to-many relationship, and you whant to reach the "many" chart through the "one" chart, you should create a subquery we suppose the company->employees.
DEVELOPER USAGE
The chart is obtained calling charter.php with the following parameters with the post or the url parameters:
query_id=[A generic number]
x_fields=[The comma separated list of field to show on x]
y_fields=[The comma separated list of field to show on y]
where_clause=[The where clause]
query_name=[The name of the query a generic string]
table_name=[The mySQL table name on wich create chart,CASE SENSITIVE]
ord_by_fields=[The order by clause]
start_setp=[The mySQL LIMIT first parameter]
end_step=[The mySQL LIMIT second parameter]
y_dim_labels=[The width of the labels, for bars and lines]
y_dim_chart=[The width of the chart]
reversed=[Invert x*y with y*x can be 1 or 0]
chart_type=[May be stacked-bars,bars,lines,pie]
The same parameters are used to call the chart_container.php. The only needed files are strictly charter.php and the include section (with of course this readme and the license).
LICENSING
This is distributed with NO WARRANTY and under the terms of the GNU GPL and PHP licenses. If you use it a notice or some credit would be nice.
You can get a copy of the GNU GPL at http://www.gnu.org/copyleft/gpl.html
You can get a copy of the PHP License at http://www.php.net/license.html
You can downlod graza here
See http://www.kendar.org/ for the latest changes.