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);
?>
Choosing the perfect Magento Custom Development is quite a challenging task. As being a technical…
Usually finding a perfect React JS Development Company is a difficult task, but to simplify…
Have you ever worried about things that you should consider while choosing Shopify Website Development…
Have you ever thought that is it important to hire an SEO Company in India…
You can easily grow your e-commerce business with Magento Custom Development Services from Raghwandra. Our…
Every person who has an online business always wants seamless web development and smooth performance.…