area graph

2D/3D Area Graph for PHP

[ Graph Home ] [ Set-Up ] [ Tutorials ] [ Documentation ] [ Buy Now ] [ Support ]

2D/3D Area Graph for PHP

Tutorials - Data Script function

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 tutorial demonstrates how to set the graph to dynamically use a custom PHP data script function. This method provides enormous flexibility and is particularly useful where data is to be retrieved based upon the person viewing the graph (eg. a user ID stored in the SESSION ).

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/areagraph/area-graph.php?
datascript=datascript.php&
config=[URL FilePath]/config.txt"
width=300
height=300>

Save the web page and load it up to your web server.

 

Step 2 - Create the datascript.php file

From the /tutorials/ directory (of this package) copy the file datascript.php to your web server.

This file should be placed in the same directory as the area-graph.php file.

 

 

Notes:

The datascript.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.


Step 3- Create the config files

From the /tutorials/ directory (of this package) copy the config.txt to your web server.

This file should be placed in the same directory as your web page.

 

 

Notes:

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 Area Graph with 12 points plotted (6 for each series).

This graph now contains many more features including:-

  • Titles
  • Legend
  • Trend & Target Areas
  • Custom Text
  • etc.

 

Follow-Up Suggestion:

Extend the datascript.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 !

In addition any SESSION data that exists is also available to the data script function. Therefore it would be possible to construct data based upon the current SESSION (eg. a user ID).

 

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 or you wish to dynamically acquire the data based upon a parameter of the current SESSION then this method is an ideal solution.

 

 

 

« back to Getting Started

 


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.

[ Graph Home ] [ Set-Up ] [ Tutorials ] [ Documentation ] [ Buy Now ] [ Support ]

How it Works »

How the graphing software works.

Quick Set-Up and Install »

step-by- step guide to add graphing for your site.

Tutorials »

Introducing many powerful features.

Licensing and Purchase Options »

Click the 'Buy & Download' button to review options.

buy and download area graph graph for php

Documentation »

Full documentation

Help and Support »

If at any stage you require help or advice then please feel free to ask.

Contact us here »