GD library is useful for creating 2D charts.
Graph Image
Copy and paste this code in your php file
<!–/ By Raghwendra$graphValues=array(50,80,23,11,190,120,50,80,111,210,55);
$graphValues_city=array(‘mumbai’,’delhi’,’channai’,’banglore’,’chandigarh’,
‘surat’,’kanpur’,’patna’,’hyderabad’,’jammu’,’lacknow’);
header(“Content-type: image/png”);
$imgWidth=1000;
$imgHeight=280;
// Create image and define colors
$image=imagecreate($imgWidth, $imgHeight);
$colorWhite=imagecolorallocate($image, 255, 255, 255);
$colorGrey=imagecolorallocate($image, 192, 192, 192);
$colorBlue=imagecolorallocate($image, 0, 0, 255);
// Create border around image
imageline($image, 0, 0, 0, 250, $colorGrey);
imageline($image, 0, 249, 1000, 249, $colorGrey);
for ($i=0; $i<11; $i++)
{
imagefilledrectangle($image, ($i*80)+10, (250-$graphValues[$i])+1, (($i+1)*80)-20, 248, $colorBlue);
imagefttext( $image, 10, 0, ($i*80)+strlen($graphValues_city[$i]),270, $colorGrey, ‘trebuc.ttf’, $graphValues_city[$i], array(‘lineheight’=>2.0) );
imagefttext( $image, 10, 0, ($i*80)+20,244-$graphValues[$i], $colorGrey, ‘trebuc.ttf’, $graphValues[$i], array(‘lineheight’=>2.0) );
}
imagepng($image);
imagedestroy($image);
//imagefilledrectangle($image, $i*25, (250-$graphValues[$i]), ($i+1)*25, 250, $colorBlue);
//imagefilledrectangle($image, ($i*50)-10, (250-$graphValues[$i])+1, (($i+1)*50)-5, 248, $colorBlue);
?>
The signs your business has outgrown its software can be small and daily. Staff type…
A website not getting leads usually has a problem in one of five places. Visitors…
Web development quotes vary because they cover different scope, different amounts of testing and support,…
Your store is ready for agentic commerce when AI shopping agents can find your products,…
The psychology of minimalism in branding is simple. People find clean designs easier to take…
A convolutional neural network (CNN) is a type of AI that learns from labelled examples…