Tag-Archive for ◊ open source ◊

Author:
Thursday, October 01st, 2009

When we think of Open Source Software, the first software which comes into mind under web category is PHP. We have solution for most of the common issues like Contant Management, Customer relationship management, Project Management etc…

Many companies completely depend on PHP opensource tools. PHP make us to think why we need to €œreinvent the wheel€. I am listing out the list of open source softwares which are very useful.

These are some of the softwares which I know, still lot of open source projects available in PHP. Why can’t you guys get it and use it with less efforts?

Category: PHP | Tags: , , , , , ,  | 11 Comments
Author:
Tuesday, September 01st, 2009

I have developed a graphical solution for our prestigious client. Graphical solution includes generating Bar chart, Pie chart, line chart, Stacked bar chart, Multiple bar chart. I have done a simple search to get the list of open source applications which is available in market to provide the Chart solution.

I have got a list of opensource PHP Charts

1. JPGraph
2. GraPHPite
3. Open Flash Chart
etc…

We had chosen JPGraph since it has most of the chart types. But on the next day, I got to know its not completely open source, for commercial purpose we need to get license.

I started searching for some solution which is provided by PHP.

I got a fantastic PEAR package, “Image_Graph”.

PHP professionals knows what is PEAR (PHP Extension and Application Repository). Its is a framework and distribution system for reusable PHP components.

We can handle most of the charts using Image_Graph. Some of them are

Bar Chart, Pie Chart, Line Chart, Donut Chart, Step Chart, Logarithmic Charts, Area Chart, CandleStick Chart, rador Chart, Impulse Chart, Dot Chart, Band Chart and BoxWhisker charts with stacked and gradient effects. Its a cool package.

Click here to have a look at the list of graphs

Requirements need to check before starting with Image_Graph

1. Your PHP should support Graphics, for that you need to install and enable GD Library.

Click here to get more details about GD Library

2. Your PHP version on server should me more than 4.3.0, suggested to keep PHP 5

3. You need to have the following PEAR packages in your server.

i. Image_Canvas-0.3.1
[Linux Command to install : pear install Image_Canvas-0.3.1 ]

ii. Image_Color-1.0.3
[Linux Command to install: sudo pear install Image_Color-1.0.3]

If you have done with all the above stuffs, you are ready to install Image_Graph PEAR Package.

Linux Command: pear install Image_Graph-0.7.2

For Manual installation Download the Image_Graph and move it to the PEAR path.

Try Examples in Local:

1. Download Image_Graph Package
2. Unzip the package
3. Move the unzipped folder to the web root of your Apache [either www / htdocs].
4. You can access the examples using url : http://localhost/Image_Graph/docs/examples/

By exploring the examples, you will get to know the various way of implementation. Its very simple if you know the basics of PHP.

Issues Which I faced during production upload:

The problems which I faced are

1. Missing of Fonts:

I got a warning like “Warning: imagettfbbox(): Could not find/open font in /usr/share/php/Image/Canvas/GD.php on line 1245

Solution:
This occurs if you don’t have the correct (or any) fonts in your Fonts directory, found at php/Image/Canvas/Fonts/. Make sure that you have the corresponding .ttf file located in your Fonts directory

2. Issues with Legends for Pie/Donut charts

I got one more issue, that legends are not shown for Pie/Donut Charts. Refer: http://pear.veggerby.dk/samples/show/id/gradient_pie/

I searched for solutions. Finally the issue is with Image_Graph PEAR Package. They have included 2 lines which caused the problem. I didn’t analyse the functioanlity of the 2 lines. But the solution is simple, comment that two lines in the installed package.

Solution:

1. You need to find the PEAR package’s include path.

2. By checking the phpinfo using method [phpinfo( )], you can get the path “include_pathPHPinfo

3. In file /usr/share/php/Image/Graph/Plot/Pie.php, comment the following lines
Line 502: // $this->_clip(true);
Line 616: // $this->_clip(false);

I hope this will defenitely help peoples who is going for “Image_Graph” PEAR Package. Enjoy coding :)