<?php
//=======================================================================
// File: JPGRAPH.PHP
// Description: PHP Graph Plotting library. Base module.
// Created: 2001-01-08
// Ver: $Id: jpgraph.php 1924 2010-01-11 14:03:26Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
require_once('jpg-config.inc.php');
require_once('jpgraph_gradient.php');
require_once('jpgraph_errhandler.inc.php');
require_once('jpgraph_ttf.inc.php');
require_once('jpgraph_rgb.inc.php');
require_once('jpgraph_text.inc.php');
require_once('jpgraph_legend.inc.php');
require_once('gd_image.inc.php');
// Version info
define('JPG_VERSION','3.0.7');
// Minimum required PHP version
define('MIN_PHPVERSION','5.1.0');
// Special file name to indicate that we only want to calc
// the image map in the call to Graph::Stroke() used
// internally from the GetHTMLCSIM() method.
define('_CSIM_SPECIALFILE','_csim_special_');
// HTTP GET argument that is used with image map
// to indicate to the script to just generate the image
// and not the full CSIM HTML page.
define('_CSIM_DISPLAY','_jpg_csimd');
// Special filename for Graph::Stroke(). If this filename is given
// then the image will NOT be streamed to browser of file. Instead the
// Stroke call will return the handler for the created GD image.
define('_IMG_HANDLER','__handle');
// Special filename for Graph::Stroke(). If this filename is given
// the image will be stroked to a file with a name based on the script name.
define('_IMG_AUTO','auto');
// Tick density
define("TICKD_DENSE",1);
define("TICKD_NORMAL",2);
define("TICKD_SPARSE",3);
define("TICKD_VERYSPARSE",4);
// Side for ticks and labels.
define("SIDE_LEFT",-1);
define("SIDE_RIGHT",1);
define("SIDE_DOWN",-1);
define("SIDE_BOTTOM",-1);
define("SIDE_UP",1);
define("SIDE_TOP",1);
// Legend type stacked vertical or horizontal
define("LEGEND_VERT",0);
define("LEGEND_HOR",1);
// Mark types for plot marks
define("MARK_SQUARE",1);
define("MARK_UTRIANGLE",2);
define("MARK_DTRIANGLE",3);
define("MARK_DIAMOND",4);
define("MARK_CIRCLE",5);
define("MARK_FILLEDCIRCLE",6);
define("MARK_CROSS",7);
define("MARK_STAR",8);
define("MARK_X",9);
define("MARK_LEFTTRIANGLE",10);
define("MARK_RIGHTTRIANGLE",11);
define("MARK_FLASH",12);
define("MARK_IMG",13);
define("MARK_FLAG1",14);
define("MARK_FLAG2",15);
define("MARK_FLAG3",16);
define("MARK_FLAG4",17);
// Builtin images
define("MARK_IMG_PUSHPIN",50);
define("MARK_IMG_SPUSHPIN",50);
define("MARK_IMG_LPUSHPIN",51);
define("MARK_IMG_DIAMOND",52);
define("MARK_IMG_SQUARE",53);
define("MARK_IMG_STAR",54);
define("MARK_IMG_BALL",55);
define("MARK_IMG_SBALL",55);
define("MARK_IMG_MBALL",56);
define("MARK_IMG_LBALL",57);
define("MARK_IMG_BEVEL",58);
// Inline defines
define("INLINE_YES",1);
define("INLINE_NO",0);
// Format for background images
define("BGIMG_FILLPLOT",1);
define("BGIMG_FILLFRAME",2);
define("BGIMG_COPY",3);
define("BGIMG_CENTER",4);
define("BGIMG_FREE",5);
// Depth of objects
define("DEPTH_BACK",0);
define("DEPTH_FRONT",1);
// Direction
define("VERTICAL",1);
define("HORIZONTAL",0);
// Axis styles for scientific style axis
define('AXSTYLE_SIMPLE',1);
define('AXSTYLE_BOXIN',2);
define('AXSTYLE_BOXOUT',3);
define('AXSTYLE_YBOXIN',4);
define('AXSTYLE_YBOXOUT',5);
// Style for title backgrounds
define('TITLEBKG_STYLE1',1);
define('TITLEBKG_STYLE2',2);
define('TITLEBKG_STYLE3',3);
define('TITLEBKG_FRAME_NONE',0);
define('TITLEBKG_FRAME_FULL',1);
define('TITLEBKG_FRAME_BOTTOM',2);
define('TITLEBKG_FRAME_BEVEL',3);
define('TITLEBKG_FILLSTYLE_HSTRIPED',1);
define('TITLEBKG_FILLSTYLE_VSTRIPED',2);
define('TITLEBKG_FILLSTYLE_SOLID',3);
// Styles for axis labels background
define('LABELBKG_NONE',0);
define('LABELBKG_XAXIS',1);
define('LABELBKG_YAXIS',2);
define('LABELBKG_XAXISFULL',3);
define('LABELBKG_YAXISFULL',4);
define('LABELBKG_XYFULL',5);
define('LABELBKG_XY',6);
// Style for background gradient fills
define('BGRAD_FRAME',1);
define('BGRAD_MARGIN',2);
define('BGRAD_PLOT',3);
// Width of tab titles
define('TABTITLE_WIDTHFIT',0);
define('TABTITLE_WIDTHFULL',-1);
// Defines for 3D skew directions
define('SKEW3D_UP',0);
define('SKEW3D_DOWN',1);
define('SKEW3D_LEFT',2);
define('SKEW3D_RIGHT',3);
// For internal use only
define("_JPG_DEBUG",false);
define("_FORCE_IMGTOFILE",false);
define("_FORCE_IMGDIR",'/tmp/jpgimg/');
//
// Automatic settings of path for cache and font directory
// if they have not been previously specified
//
if(USE_CACHE) {
if (!defined('CACHE_DIR')) {
if ( strstr( PHP_OS, 'WIN') ) {
if( empty($_SERVER['TEMP']) ) {
$t = new ErrMsgText();
$msg = $t->Get(11,$file,$lineno);
die($msg);
}
else {
define('CACHE_DIR', $_SERVER['TEMP'] . '/');
}
} else {
define('CACHE_DIR','/tmp/jpgraph_cache/');
}
}
}
elseif( !defined('CACHE_DIR') ) {
define('CACHE_DIR', '');
}
//
// Setup path for western/latin TTF fonts
//
if (!defined('TTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('TTF_DIR', $sroot.'/fonts/');
}
} else {
define('TTF_DIR','/usr/share/fonts/truetype/');
}
}
//
// Setup path for MultiByte TTF fonts (japanese, chinese etc.)
//
if (!defined('MBTTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('MBTTF_DIR', $sroot.'/fonts/');
}
} else {
define('MBTTF_DIR','/usr/share/fonts/truetype/');
}
}
//
// Check minimum PHP version
//
function CheckPHPVersion($aMinVersion) {
list($majorC, $minorC, $editC) = preg_split('/[\/.-]/', PHP_VERSION);
list($majorR, $minorR, $editR) = preg_split('/[\/.-]/', $aMinVersion);
if ($majorC != $majorR) return false;
if ($majorC < $majorR) return false;
// same major - check minor
if ($minorC > $minorR) return true;
if ($minorC < $minorR) return false;
// and same minor
if ($editC >= $editR) return true;
return true;
}
//
// Make sure PHP version is high enough
//
if( !CheckPHPVersion(MIN_PHPVERSION) ) {
JpGraphError::RaiseL(13,PHP_VERSION,MIN_PHPVERSION);
die();
}
//
// Make GD sanity check
//
if( !function_exists("imagetypes") || !function_exists('imagecreatefromstring') ) {
JpGraphError::RaiseL(25001);
//("This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)");
}
//
// Setup PHP error handler
//
function _phpErrorHandler($errno,$errmsg,$filename, $linenum, $vars) {
// Respect current error level
if( $errno & error_reporting() ) {
JpGraphError::RaiseL(25003,basename($filename),$linenum,$errmsg);
}
}
if( INSTALL_PHP_ERR_HANDLER ) {
set_error_handler("_phpErrorHandler");
}
//
// Check if there were any warnings, perhaps some wrong includes by the user. In this
// case we raise it immediately since otherwise the image will not show and makes
// debugging difficult. This is controlled by the user setting CATCH_PHPERRMSG
//
if( isset($GLOBALS['php_errormsg']) && CATCH_PHPERRMSG && !preg_match('/|Deprecated|/i', $GLOBALS['php_errormsg']) ) {
JpGraphError::RaiseL(25004,$GLOBALS['php_errormsg']);
}
// Useful mathematical function
function sign($a) {return $a >= 0 ? 1 : -1;}
//
// Utility function to generate an image name based on the filename we
// are running from and assuming we use auto detection of graphic format
// (top leve
没有合适的资源?快使用搜索试试~ 我知道了~
关于jpgraph类
共2000个文件
png:963个
html:709个
php:508个
需积分: 0 13 下载量 13 浏览量
2011-06-17
11:45:42
上传
评论
收藏 11.08MB RAR 举报
温馨提示
jpgraph类很不错,各样各式的,图形,
资源推荐
资源详情
资源评论
收起资源包目录
关于jpgraph类 (2000个子文件)
example28.php.bak 431B
manual.css 8KB
phphl.css 1KB
flags.dat 960KB
flags_thumb100x100.dat 671KB
flags_thumb60x60.dat 367KB
flags_thumb35x35.dat 209KB
flag_mapping 10KB
tiger_bkg.gif 19KB
checkmark-plain.gif 120B
Graph.html 190KB
GTextTable.html 186KB
ch16s04.html 182KB
ch15.html 175KB
ch21s07.html 154KB
class_toc.html 150KB
apc.html 125KB
index.html 96KB
ch16.html 91KB
ch27.html 83KB
apd.html 82KB
AxisPrototype.html 77KB
ch29s05.html 68KB
ch30s05.html 68KB
ch31s05.html 67KB
ch27s02.html 66KB
ch14s10.html 65KB
Text.html 64KB
ccbpgraph.class.html 64KB
WindrosePlot.html 61KB
apf.html 59KB
ch15s02.html 58KB
ch26s02.html 58KB
aph.html 56KB
ch20s02.html 54KB
PiePlot.html 52KB
ch27s03.html 51KB
Shape.html 50KB
ch04s02.html 50KB
ch19s02.html 48KB
ch14s08.html 48KB
ch17s03.html 48KB
ch15s05.html 46KB
PlotMark.html 45KB
ch15s06.html 45KB
Legend.html 44KB
ch16s02.html 44KB
ch10s06.html 44KB
ch22s05.html 43KB
GanttGraph.html 42KB
ch14s02.html 42KB
listfontsex1.html 41KB
ch03s02.html 40KB
CanvasRectangleText.html 40KB
ch29s02.html 40KB
ch30s02.html 40KB
comb90dategraphex03.html 39KB
ch14.html 38KB
ch21s02.html 38KB
RadarGraph.html 37KB
ch25s04.html 35KB
ch22s04.html 34KB
ch23s09.html 33KB
ch24s09.html 33KB
IconPlot.html 33KB
BarPlot.html 33KB
ch03s03.html 32KB
ch13s03.html 32KB
ch26.html 32KB
ch21s06.html 32KB
HeaderProperty.html 31KB
PiePlot3D.html 30KB
ch25s08.html 30KB
LinePlot.html 29KB
ch22s09.html 29KB
MGraph.html 29KB
ch05s05.html 29KB
ch15s09.html 29KB
ch15s08.html 29KB
DisplayValue.html 28KB
ch29.html 28KB
gantthourminex1.html 28KB
ch14s07.html 27KB
ch26s03.html 27KB
WindrosePlotScale.html 27KB
gantticonex1.html 27KB
matrix_introex.html 26KB
ch16s03.html 26KB
LegendStyle.html 26KB
MatrixPlot.html 26KB
matrix_csimex01.html 26KB
ch21.html 25KB
windrose_ex5.html 25KB
PolarGraph.html 25KB
ch23.html 25KB
GanttActivityInfo.html 25KB
PolarAxis.html 25KB
MatrixLegend.html 25KB
Ticks.html 25KB
ganttex30.html 24KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
ihy868
- 粉丝: 16
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功