Thursday, April 11, 2013

Line graph using php

I this blog I am sharing a simple code to draw a line graph using php. Here I am using a value_array to hold my data for drawing the graph. If  we wants to draw the graph based on records  from database just replace the values of $value_array. Here I’m assumed that there is only 12 in that array. $value_array=array(); $value_array[1] = 3500; $value_array[2] = 2000; $value_array[3] = 5000; $value_array[4] = 500; $value_array[5] = 2500; $value_array[6] = 5; $value_array[7] = 4250; $value_array[8] = 1110; $value_array[9] = 3720; $value_array[10] = 1190; $value_array[11] = 2670; $value_array[12] = 440; $array_count=count($value_array);                 $imagewd=600; //X...

How to Create a Graph using PHP

Here I am describing a simple method to create a dynamic bar graph using php. Here I am utilizing the php image functions based on GD image library. We can us this code for representing your dates’ in graphical format. I am used a array ($values) for holding my data. We can take data in to this array either from the database or just give directly. # ------This is my data to be displayed as graph $values  =array(); $values[2010]=120; $values[2011]=70; $values[2012]=150; $values[2013]=200; $values[2014]=45; $values[2015]=110; $img_width=650; $img_height=400; $margins=20; # ---- Find the size of graph by subtracting the...

Pages 212 »

 
Powered by Blogger