<?php
//=======================================================================
// File: JPGRAPH.PHP
// Description: PHP Graph Plotting library. Base module.
// Created: 2001-01-08
// Ver: $Id: jpgraph.php 1076 2008-09-19 15:43:22Z ljp $
//
// Copyright 2006 (c) Aditus Consulting. All rights reserved.
//========================================================================
require_once('jpg-config.inc.php');
require_once('jpgraph_errhandler.inc.php');
require_once('gd_image.inc.php');
require_once('jpgraph_ttf.inc.php');
require_once 'jpgraph_gradient.php';
// Version info
DEFINE('JPG_VERSION','1.26.1-dev');
// Minimum required PHP version
DEFINE('MIN_PHPVERSION','4.3.1');
//------------------------------------------------------------------------
// 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', '');
}
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/X11R6/lib/X11/fonts/truetype/');
}
}
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('TTF_DIR', $sroot.'/fonts/');
}
} else {
DEFINE('MBTTF_DIR','/usr/share/fonts/ja/TrueType/');
}
}
//------------------------------------------------------------------
// Constants which are used as parameters for the method calls
//------------------------------------------------------------------
// 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);
// 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);
// 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/');
function CheckPHPVersion($aMinVersion)
{
list($majorC, $minorC, $editC) = split('[/.-]', PHP_VERSION);
list($majorR, $minorR, $editR) = split('[/.-]', $aMinVersion);
if ($majorC > $majorR) return true;
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);
}
//
// Routine to determine if GD1 or GD2 is installed
//
function CheckGDVersion() {
if( !function_exists("imagetypes") || !function_exists('imagecreatefromstring') )
return 0;
$GDfuncList = get_extension_funcs('gd');
if( !$GDfuncList )
return 0 ;
else {
if( in_array('imagegd2',$GDfuncList) &&
in_array('imagecreatetruecolor',$GDfuncList))
return 2;
else
return 1;
}
}
//
// Check what version of the GD library is installed.
//
$gdversion = CheckGDVersion();
if( $gdversion != 2 ) {
JpGraphError::RaiseL(25002);
//(" Your PHP installation does not seem to have the required GD 2.x library. Please see the PHP documentation on how to install and enable the GD library.");
}
//
// 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
//
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 level), i.e it is safe to call this function
// from a script that uses JpGraph
function GenImgName() {
global $_SERVER;
// Determine what format we should use when we save the images
$supported = imagetypes();
if( $supported & IMG_PNG ) $img_format="png";
elseif( $supported & IMG_GIF ) $img_format="gif";
elseif( $supported & IMG_JPG ) $img_format="jpeg";
elseif( $supported & IMG_WBMP ) $img_format="wbmp";
elseif( $supported & IMG_XPM ) $img_format="xpm";
if( !isset($_SERVER['PHP_SELF']) )
JpGraphError::RaiseL(25005);
//(" Can't access PHP_SELF, PHP global variable. You can't run PHP from command line if you want to use the 'auto' naming of cache or image files.");
$fname = basename($_SERVER['PHP_SELF']);
if( !empty($_SERVER['QUERY_STRING']) ) {
$q = @$_SERVER['QUERY_STRING'];
$fname .= '_'.preg_replace("/\W/", "_", $q).'.'.$img_format;
}
else {
$fname = substr($fname,0,strlen($fname)-4).'.'.$img_format;
}
return $fname;
}
//============
没有合适的资源?快使用搜索试试~ 我知道了~
jpgraph-1.27.tar.gz
4星 · 超过85%的资源 需积分: 10 21 下载量 33 浏览量
2009-04-15
23:57:38
上传
评论 1
收藏 4.45MB GZ 举报
温馨提示
共1711个文件
html:1095个
php:382个
png:208个
php程序的图形库,在搭建snort平台的过程中需要用到这一程序。
资源推荐
资源详情
资源评论
收起资源包目录
jpgraph-1.27.tar.gz (1711个子文件)
jpgmanual.css 3KB
flags.dat 960KB
flags_thumb100x100.dat 671KB
flags_thumb60x60.dat 367KB
flags_thumb35x35.dat 209KB
tiger_bkg.gif 19KB
manual_jpgraph.html 518KB
GTextTable.html 126KB
Graph.html 121KB
class_toc.html 97KB
Axis.html 57KB
Text.html 46KB
canvas_jpgarchex.html 40KB
PiePlot.html 40KB
PlotMark.html 34KB
Shape.html 34KB
Legend.html 32KB
105SampleapplicationDrawingDBschema.html 28KB
115SampleapplicationDrawingDBschema.html 28KB
CanvasRectangleText.html 26KB
GanttGraph.html 23KB
RadarGraph.html 23KB
BarPlot.html 22KB
toc.html 21KB
dbschemaex1.html 21KB
LinePlot.html 20KB
HeaderProperty.html 20KB
listfontsex1.html 20KB
Ticks.html 19KB
PiePlot3D.html 19KB
DateLocale.html 19KB
gantthourminex1.html 18KB
Image.html 18KB
DisplayValue.html 18KB
gantticonex1.html 18KB
104Usingacanvasscale.html 17KB
114Usingacanvasscale.html 17KB
GanttActivityInfo.html 17KB
PolarAxis.html 17KB
bar_csimex3.html 16KB
textalignex1.html 16KB
ganttex12.html 16KB
barlinefreq_csimex1.html 16KB
ganttex10.html 15KB
ganttex11.html 15KB
horizbarex3.html 15KB
fieldscatterex1.html 15KB
loglogex1.html 15KB
PolarGraph.html 14KB
7102Specifyingadatetimescalewithamanualcallback.html 14KB
8102Specifyingadatetimescalewithamanualcallback.html 14KB
impulsex4.html 14KB
93AsimpleGanttchart.html 13KB
103AsimpleGanttchart.html 13KB
IconPlot.html 13KB
GraphTabTitle.html 13KB
ganttex19.html 13KB
ganttex18.html 13KB
SuperScriptText.html 13KB
GanttBar.html 13KB
71Lineplots.html 13KB
ganttex17.html 12KB
81Lineplots.html 12KB
titlecsimex01.html 12KB
PlotLine.html 12KB
alphabarex1.html 12KB
gantthgridex1.html 12KB
piec_csimex1.html 12KB
LinearTicks.html 12KB
PiePlotC.html 12KB
polarex9.html 11KB
staticbandbarex7.html 11KB
ganttex09.html 11KB
gradbkgex1.html 11KB
ganttex16.html 11KB
RadarPlot.html 11KB
ganttex08.html 11KB
builtinplotmarksex1.html 11KB
GanttScale.html 11KB
funcex1.html 11KB
GanttPlotObject.html 11KB
horizbarex2.html 11KB
TextProperty.html 11KB
PolarPlot.html 11KB
Plot.html 11KB
CanvasScale.html 11KB
polarex7-2.html 11KB
7101Usingtheautomaticdatetimescale.html 10KB
103Addinglinesandrectanglestoacanvas.html 10KB
gantthourex1.html 10KB
113Addinglinesandrectanglestoacanvas.html 10KB
8101Usingtheautomaticdatetimescale.html 10KB
inyaxisex2.html 10KB
ganttex13.html 10KB
RotImage.html 10KB
PieGraph.html 10KB
PlotBand.html 10KB
example17.html 10KB
14CodedefinesinJpGraph.html 10KB
13CodedefinesinJpGraph.html 10KB
共 1711 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18
资源评论
- kabujinuo202012-10-08可以装的,但是后来发现不适用于ubuntu的mantis安装
linnanll
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ### 词向量的介绍、使用技巧和优缺点的文章
- 基于STM32F103CBT6单片机GC65+MP2625+CC1101 GPSTrack模块板硬件(原理图+PCB)工程文件
- ### 通道处理过程模拟概念、优缺点和使用技巧
- ### MyBatis动态SQL介绍说明、使用技巧和优缺点
- 上传下载仿163网盘无刷新文件上传 for Jsp-fileupload-jsp.rar
- VMware Workstation业界非常稳定且安全的桌面虚拟机软件-计算机上运行多个操作系统,支持Windows、DOS等
- 基于STM8L101F3P6单片机+LY2508A33P+CC1100遥控器硬件(原理图+PCB)工程文件.zip
- 上传下载WAP图铃下载系统-unimg.rar
- YTX-0.1.0-Win
- 上传下载ExtJS 2.2 开源网络硬盘系统-dogdisk.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功