PHP drawing, please modify the expert.

Source: Internet
Author: User
Tags image png what php
 $zuidashujuzhi) $zuidashujuzhi = $shuju [$i];} Calculate image Width $img _kuan= $zuo + $you + $jiange +count ($shuju) * ($kuan + $jiange);//Image high $IMG _gao=170;//storage column height array $zhugaodu = array (); $image = Imagecreate ($img _kuan, $img _gao); $white = Imagecolorallocate ($image, 0xEE, 0xEE, 0xEE);//color column Color $shuju_yanse = Array (imagecolorallocate ($image, 0x97, 0XBD, 0x00), Imagecolorallocate ($image, 0x00, 0x99, 0x00), Imagecolorallocate ($ Image, 0XCC, 0x33, 0x00), Imagecolorallocate ($image, 0xFF, 0XCC, 0x00), Imagecolorallocate ($image, 0x33, 0x66, 0XCC), Imagecolorallocate ($image, 0x33, 0XCC, 0x33), Imagecolorallocate ($image, 0xFF, 0x99, 0x33), Imagecolorallocate ($image, 0XCC, 0XCC, 0x99), Imagecolorallocate ($image, 0x99, 0XCC, 0x66), Imagecolorallocate ($image, 0x66, 0xFF, 0x99));//Axis color $ Zuobiao_yanse = Imagecolorallocate ($image, 0x00, 0x00, 0x00);//Horizontal Imageline ($image, $zuo, $img _gao-$xia, $img _kuan-$you /2, $img _gao-$xia, $zuobiao _yanse);//longitudinal axis imageline ($image, $zuo, $shang/2, $zuo, $img _gao-$xia, $zuobiao _yanse);//Vertical Axis scale, A total of 4 points on the vertical axis, so I can be calculated separatelyMageline ($image, $zuo, $shang, $zuo +6, $shang, $zuobiao _yanse), Imagestring ($image, 3, $zuo/4, $shang, round ($zuidashuju Zhi), $zuobiao _yanse), Imageline ($image, $zuo, $shang + ($img _gao-$shang-$xia) *1/4, $zuo +6, round ($shang + ($img _gao-$ shang-$xia) *1/4), $zuobiao _yanse) imagestring ($image, 3, $zuo/4, $shang + ($img _gao-$shang-$xia) *1/4,round ($ ZUIDASHUJUZHI*3/4), $zuobiao _yanse), Imageline ($image, $zuo, $shang + ($img _gao-$shang-$xia) *2/4, $zuo +6, $shang + ($img _gao-$shang-$xia) *2/4, $zuobiao _yanse); Imagestring ($image, 3, $zuo/4, $shang + ($img _gao-$shang-$xia) *2/4,round ($ ZUIDASHUJUZHI*2/4), $zuobiao _yanse), Imageline ($image, $zuo, $shang + ($img _gao-$shang-$xia) *3/4, $zuo +6, $shang + ($img _gao-$shang-$xia) *3/4, $zuobiao _yanse); Imagestring ($image, 3, $zuo/4, $shang + ($img _gao-$shang-$xia) *3/4,round ($ ZUIDASHUJUZHI*1/4), $zuobiao _yanse);//Get the height of each bar for ($i =0; $i
 
  
 


This way you can generate

img.php?a=5.4,2,30.2,4,0,6,7.7,3.8,2,3,4
Use the following parameter to get the picture above:
I now want to get to such as 5.4 inside, I divided into three properties, and display the name of each column, how to improve the code.


And the following types are not limited, such as steel pipe, aluminum tube, copper tube, gold tube, ... There are a number of.
But there are only three properties .... Each is an integer ...

Ask an expert to help modify the code, or give me a simple code. Thank you so much.


Reply to discussion (solution)

 $zuidashujuzhi) $zuidashujuzhi = $shuju [$i];} Calculate image Width $img _kuan= $zuo + $you + $jiange +count ($shuju) * ($kuan + $jiange);//Image high $IMG _gao=170;//storage column height array $zhugaodu = array (); $image = Imagecreate ($img _kuan, $img _gao); $white = Imagecolorallocate ($image, 0xEE, 0xEE, 0xEE);//color column Color $shuju_yanse = Array (imagecolorallocate ($image, 0x97, 0XBD, 0x00), Imagecolorallocate ($image, 0x00, 0x99, 0x00), Imagecolorallocate ($ Image, 0XCC, 0x33, 0x00), Imagecolorallocate ($image, 0xFF, 0XCC, 0x00), Imagecolorallocate ($image, 0x33, 0x66, 0XCC), Imagecolorallocate ($image, 0x33, 0XCC, 0x33), Imagecolorallocate ($image, 0xFF, 0x99, 0x33), Imagecolorallocate ($image, 0XCC, 0XCC, 0x99), Imagecolorallocate ($image, 0x99, 0XCC, 0x66), Imagecolorallocate ($image, 0x66, 0xFF, 0x99));//Axis color $ Zuobiao_yanse = Imagecolorallocate ($image, 0x00, 0x00, 0x00);//Horizontal Imageline ($image, $zuo, $img _gao-$xia, $img _kuan-$you /2, $img _gao-$xia, $zuobiao _yanse);//longitudinal axis imageline ($image, $zuo, $shang/2, $zuo, $img _gao-$xia, $zuobiao _yanse);//Vertical Axis scale, A total of 4 points on the vertical axis, so I can be calculated separatelyMageline ($image, $zuo, $shang, $zuo +6, $shang, $zuobiao _yanse), Imagestring ($image, 3, $zuo/4, $shang, round ($zuidashuju Zhi), $zuobiao _yanse), Imageline ($image, $zuo, $shang + ($img _gao-$shang-$xia) *1/4, $zuo +6, round ($shang + ($img _gao-$ shang-$xia) *1/4), $zuobiao _yanse) imagestring ($image, 3, $zuo/4, $shang + ($img _gao-$shang-$xia) *1/4,round ($ ZUIDASHUJUZHI*3/4), $zuobiao _yanse), Imageline ($image, $zuo, $shang + ($img _gao-$shang-$xia) *2/4, $zuo +6, $shang + ($img _gao-$shang-$xia) *2/4, $zuobiao _yanse); Imagestring ($image, 3, $zuo/4, $shang + ($img _gao-$shang-$xia) *2/4,round ($ ZUIDASHUJUZHI*2/4), $zuobiao _yanse), Imageline ($image, $zuo, $shang + ($img _gao-$shang-$xia) *3/4, $zuo +6, $shang + ($img _gao-$shang-$xia) *3/4, $zuobiao _yanse); Imagestring ($image, 3, $zuo/4, $shang + ($img _gao-$shang-$xia) *3/4,round ($ ZUIDASHUJUZHI*1/4), $zuobiao _yanse);//Get the height of each bar for ($i =0; $i
 
  
 


This way you can generate

img.php?a=5.4,2,30.2,4,0,6,7.7,3.8,2,3,4
Use the following parameter to get the picture above:
I now want to get to such as 5.4 inside, I divided into three properties, and display the name of each column, how to improve the code.


And the following types are not limited, such as steel pipe, aluminum tube, copper tube, gold tube, ... There are a number of.
But there are only three properties .... Each is an integer ...

Ask an expert to help modify the code, or give me a simple code. Thank you so much.


Where did the Tall man go?

It's easy to draw Chinese characters, Imagettftext can be done easily
But I can't organize the data for you.

I now want to get to such as 5.4 inside, I divided into three properties, and display the name of each column, how to improve the code.
And the following types are not limited, such as steel pipe, aluminum tube, copper tube, gold tube, ... There are a number of.
But there are only three properties .... Each is an integer ... The ordinate will draw, according to change can draw the horizontal axis of Satan. The data column can be nested with two loops, outside the loop n times, N is the number of tubes, and set each kind of interval length; inside the loop, draw a bar chart, no spacing. Then calculate the height of the map coordinates, write the number of characters on the line ah.

Such graphics jquery plugin a whole bunch! with what PHP painting.

Even PHP has a graphics package.

Even PHP has a graphics package.

Please expert pointing Ah, I rookie a ...


Http://www.baidu.com/s?wd=pChart


Http://www.baidu.com/s?wd=pChart

I've seen this, I'm studying usage.
Do you have an expert to tell the usage?

Look at the API, look for their example, copy it to modify the next parameter.
JS Chart Library With this is very convenient, should have to match your case: Highcharts

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.