Before following this tutorial it is essential
that the graph software has been installed.
If you have not yet done so then you should
complete the install procedure now,
Quick Set-Up
and Install »
This third tutorial demonstrates how to set
the graph to dynamically pull the data from
another PHP script. This method is not restricted
to just PHP scripts, but can be used for any
server side scripting program (eg. JSP, ASP,
Java Sevlet Perl etc).
Step
1 - Add the <IMG> tag
to your web page |
Add this HTML code to your
page
(replacing yourdomain.com
with the actual domain of
your web site and [URL
FilePath] with
the url of the web directory
where your page resides),
<img
src="http://www.yourdomain.com/jpowered/bubblechart/bubble-chart.php?
data=[URL
FilePath]/data.php&
config=[URL
FilePath]/config.php"
width=500
height=500> |
Save the web page and load
it up to your web server.
|
|
Step
2 - Create the data and config
files |
From the
/tutorials/ directory
(of this package) copy the
2 files data.php
and config.php
to your web server.
These files should be placed
in the same directory as your
web page.
|
Notes:
The data.php script is a very simple little script which outputs the data for
the graph. In a real implementation this script would be expanded to first acquire the data from another
source ( series of files or database tables) and then output the calculated data.
This
config.php script again is
a simple script which outputs
the configuration parameters
upon request. For the function
and options of each parameter
see the following page:-
Graph
Parameters »
|
|
Final
Step - View the page in a browser |
Open your web browser and
view the page.
You should see a Bubble Chart with 12 points plotted (6 for each series).
This graph now contains many
more features including:-
- Titles
- Legend
- Trend & Target Lines
- Custom Text
- etc.
|
Follow-Up
Suggestion:
Extend
the data.php script to connect
to one of your own databases
and construct data based upon
the results of a query.
Now
you have real-time graphing
!
|
When
to use this type of implementation. |
If your data is a result
of a calculation method (eg.
averaging a broad range of
data etc) or is from a database
which is not a MySQL database,
then using another server
side process to act as the
data interface provides enormous
flexibility.
In the next tutorial we shall
demonstrate how to set the
graph to connect and pull
data directly from a MySQL
database in Real-Time.
next
Tutorial »
|
|
Any
Problems ? |
In the vast majority of cases
(over 95%) the above is all
that is required. However
if you experience any problems
please feel free to tell us
and we will be happy to assist.
Contact
us here »
Please remember to include
the URL of your web page.
|
|
|