Pie chart | Bar chart PHP code:--------------------------------------------------------------------------------
/*-------------------------------------------------------------------------*/
//
Module Name: A 3D pie chart class
//
Author:avenger (avenger@php.net) Last modify:2002-10-30 11:19
Copyright (c) 2002 by Avenger
/*-------------------------------------------------------------------------*/
Common functions Section
Convert Angle to radians
function Deg2arc ($degrees) {
Return ($degrees * (pi ()/180.0));
}
Gets the value of the x,y point on the ellipse with the Ellipse Heart as (0,0)
function Pie_point ($deg, $va, $VB) {
$x = cos (DEG2ARC ($deg)) * $VA;
$y = sin (Deg2arc ($deg)) * $VB;
Return (Array ($x, $y));
}
3D Pie Chart Class
Class pie3d{
var $a; Oval Long Half axis
var $b; Elliptic Short Half axis
var $DataArray; Each sector of the data
var $ColorArray; The color of each pie is required to be written in hexadecimal but not preceded by 0x
var $Fize; Font size
For edges and shadows for black
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.