For a pie chart, you can use img to directly control its width and height.
Source: Internet
Author: User
Call method: imagesrcchart. phpchart. php is the file name of this article? * Convert the angle to the radian * functionradians ($ degrees) {return ($ degrees * (pi () 180.0);} *** to obtain (0, 0) at the center of the curve) * functioncircle_point ($ degrees, $ diameter) {$ xcos (radia // call method:
// Chart. php is the file name of this article
/*
Converts degrees to radians.
*/
Function radians ($ degrees)
{
Return ($ degrees * (pi ()/180.0 ));
}
/*
** Obtain the value of x and y on the circle (0, 0) with the center of the circle
*/
Function circle_point ($ degrees, $ diameter)
{
$ X = cos (radians ($ degrees) * ($ diameter/2 );
$ Y = sin (radians ($ degrees) * ($ diameter/2 );
Return (array ($ x, $ y ));
}
// Fill in the chart parameters
$ ChartDiameter = 200; // Chart diameter
$ ChartFont = 2; // Chart font
$ ChartFontHeight = imagefontheight ($ ChartFont); // The font size of the chart.
Require ('MySQL. php3 ');
$ SQL = new mysql_class;
$ SQL-> create ('star ');
$ SQL-> query ("select * from serch where answer = 'fujitsu Changhao Jiuduan '");
$ Record1 = $ SQL-> rows;
$ SQL-> query ("select * from serch where answer = 'fujitsu Cao Yunxuan Jiuduan '");
$ Record2 = $ SQL-> rows;
$ ChartData = array ($ record1, $ record2); // data used to generate charts, which can be determined through the database
// $ ChartLabel = array ("Changhao Jiuduan", "Cao Yunxuan Jiuduan"); // name of the data
// This script has produced an image. now you need to send it to the browser. the important thing is to send the header to the browser, let it know that it is a GIF file. Otherwise, you can only see a bunch of strange garbled characters.
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.