JPowered.com

Advanced Graphs and Charts for PHP

Plotting Data from a Database

In this example the graph is configured to read and plot data directly from a database.

This example requires that the 'Sample Application' has been set up. Setting up the Sample Application will create a database populated with data for use by this example. If you have not yet set up the Sample Application then you can do so here.

The graph above is produced using the "Database Info" method with the following IMG tag:-

The graph data is read directly from the database using the information contained in the file:-

With this method queries for each series of data are entered into the $jpDatabase["data"] array. At page view time the graphing software will dynamically include this file and execute the queries to produce the graph in real-time.

The settings and styles are set from the information contained in the file:-

If the graph above does not display then see the Troubleshooting guide for details on how to resolve the problem.

If the graph above does display but no data is shown then the most likely cause is that the graph is having trouble connecting to the database server. Ensure that the 'Sample Application' has been set up with the correct DB User credentials.

If you have not yet set up the Sample Application then you can do so here.

 

Package Index

Documentation

Troubleshooting Guide

Support

Examples

Basic Chart Styles

Bar Graphs

Cylinder Charts

Combination Charts