Ec (2); I will introduce myself again. I am a newbie. At that time, I learned php purely to cope with leadership. Let's make a Statistical Chart. I originally learned asp, suddenly changing the line is not suitable, but the php function is indeed very powerful. Oh, I can't leave him anymore. No, it's done with pie charts and column charts, but there are still many problems I won't, I also hope you give me more advice, said a lot of nonsense, I thought it was in writing that my contact information is: email: qingdaohb@yeah.netqdlov script ec (2); script
Let me introduce myself again.
I was a newbie. At that time, I learned php purely to cope with the leadership. Let's make a Statistical Chart. I originally learned asp and suddenly changed the line. However, php is really powerful, well, I can't leave him anymore. No, I have fixed all the pie charts and column charts, but I still have a lot of questions. I hope you can give me more advice and talk a lot of nonsense, I thought it was writing a letter.
My contact information is:
Email: qingdaohb@yeah.net
Http://qdlover.yeah.net
The boss rushed and couldn't help it. The pie chart function was released. You can grab it soon.
########
Bimage. php3
########
/*
Function Description
$ Chartdata: data, which is an array element
$ Chartfont: font size
$ Chartdiameter: determines the size of the pie (It depends on whether you are hungry, huh, huh)
$ Chartlabel: title, also an array element
$ Colorslice: color array, for example, $ tmp = array255, 255,255); $ colorslic = array ($ tmp );
$ Colorborder: border color, array
$ Colortext: text color, array
$ Colorbody: background color, array
$ File: output image file name */
Function bimage ($ chartdata,
$ Chartfont,
$ Chartdiameter,
$ Chartlabel,
$ Colorslice,
$ Colorbody,
$ Colorborder,
$ Colortext,
$ File
)
{
$ Chartdiameter = 150;
$ Chartfontheight = imagefontheight ($ chartfont );
$ D1 = 10; $ d2 = 20; $ d3 = 30; $ d4 = 40; $ d5 = 50;
$ Chartdata = array ($ d1, $ d2, $ d3, $ d4, $ d5 );
$ Chartlabel = array ("D1", "D2", "D3", "D4", "D5 ");
$ Chartwidth = $ chartdiameter 20;
$ Chartheight = $ chartdiameter 20 ($ chartfontheight 2) * count ($ chartdata ));
Header ("content-type: image/gif ");
$ Image = imagecreate ($ chartwidth, $ chartheight );
$ Colorbody = imagecolorallocate ($ image, $ colorbody [0], $ colorbody [1], $ colorbody [2]);
$ Colortext = imagecolorallocate ($ image, $ colortext [0], $ colortext [1], $ colortext [2]);
$ Colorborder = imagecolorallocate ($ image, $ colorborder [0], $ colorborder [1], $ colorborder [2]);
For ($ I = 0; $ I {
$ T = imagecolorallocate ($ image, $ colorslice [$ I] [0], $ colorslice [$ I] [1], $ colorslice [$ I] [2]);
$ Colorslice [$ I] = $ t;
}
For ($ I = 0; $ I {
$ Charttotal = $ chartdata [$ I];