pie chart

2D/3D Pie Chart for PHP

[ Pie Chart Home ] [ Set-Up ] [ Tutorials ] [ Documentation ] [ Buy Now ] [ Support ]

2D/3D Pie Chart for PHP

Tutorials - Connecting the Graph to files and scripts located in other directories or servers.

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 »

For simplicity, all of the preceding tutorials have assumed that the files and scripts have been located in the same directory as the web page containing the graph. However in real implementations this is generally not the case and so this tutorial is designed to show how to connect to files located elsewhere.

Step 1 - Place files in different directories

Create the following 2 directories on your web server:-

/graphinfo/

/graphpage/

Place the 2 files data.txt and config.txt in the /graphinfo/ directory.

 

Step 2 - Add the <IMG> tag to your web page.

The URL's for your data and config are now:-

http://www.yourdomain.com/graphinfo/data.txt

http://www.yourdomain.com/graphinfo/config.txt

Therefore the <IMG tag to be added is:-

<img src="http://www.yourdomain.com/jpowered/piechart/pie-chart.php?
data=http://www.yourdomain.com/graphinfo/data.txt&
config=http://www.yourdomain.com/graphinfo/config.txt"
width=300
height=300>

Replacing yourdomain.com with the actual domain of your site.

 

Notes:

If the data and/or config URL's contain parameters themselves (eg. if a parameter was being passed to a data script) then these URL's should be encoded. This is because they will be added inside the URL of the <IMG> tag.

For example if your data process was a php script which accepted a parameter "year" then the URL for this would be:-

http://www.yourdomain.com/graphinfo/data.php?year=2005

The encoded version of this would be:-

http://www.yourdomain.com/graphinfo/data.php%3Fyear%3D2005

If they are not encoded then a browser will not interpret them correctly.

If you need to encode your URL's then a good tool can be found at:-

http://www.w3schools.com/html/html_ref_urlencode.asp

 

 

Step 3 -Upload the page to your Web Server

Upload the web page to the following directory on your web server:-

/graphpage/

 

Final Step - View the page in a browser

Open your web browser and view the page.

You should see two Pie Charts each with 6 segments.

 

Follow-Up Suggestion:

Try placing the web page in other directories on your web server.

In the <IMG> tag we have used absolute URL addressing and therefore the graph will always be able to pick up the data and config from the /graphinfo/ directory, irrespective of which directory the page resides.

« back to Getting Started 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.

[ Pie Chart 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 pie chart 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 »