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