<?php
//=======================================================================
// File: JPGRAPH.PHP
// Description: PHP Graph Plotting library. Base module.
// Created: 2001-01-08
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph.php 554 2006-02-18 07:45:31Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
require_once('jpg-config.inc');
// Version info
DEFINE('JPG_VERSION','1.20.3');
// For internal use only
DEFINE("_JPG_DEBUG",false);
DEFINE("_FORCE_IMGTOFILE",false);
DEFINE("_FORCE_IMGDIR",'/tmp/jpgimg/');
DEFINE("TTF_DIR","/home/admin/domain/stat/jpgraph/");
//------------------------------------------------------------------------
// 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/');
}
}
//------------------------------------------------------------------
// Constants which are used as parameters for the method calls
//------------------------------------------------------------------
// TTF Font families
DEFINE("FF_COURIER",10);
DEFINE("FF_VERDANA",11);
DEFINE("FF_TIMES",12);
DEFINE("FF_COMIC",14);
DEFINE("FF_ARIAL",15);
DEFINE("FF_GEORGIA",16);
DEFINE("FF_TREBUCHE",17);
DEFINE("FF_GULIM", 35);
// Gnome Vera font
// Available from http://www.gnome.org/fonts/
DEFINE("FF_VERA",19);
DEFINE("FF_VERAMONO",20);
DEFINE("FF_VERASERIF",21);
// Chinese font
DEFINE("FF_SIMSUN",30);
DEFINE("FF_CHINESE",31);
DEFINE("FF_BIG5",31);
// Japanese font
DEFINE("FF_MINCHO",40);
DEFINE("FF_PMINCHO",41);
DEFINE("FF_GOTHIC",42);
DEFINE("FF_PGOTHIC",43);
// Limits for TTF fonts
DEFINE('_FF_FIRST',10);
DEFINE('_FF_LAST',43);
// Older deprecated fonts
DEFINE("FF_BOOK",91); // Deprecated fonts from 1.9
DEFINE("FF_HANDWRT",92); // Deprecated fonts from 1.9
// TTF Font styles
DEFINE("FS_NORMAL",9001);
DEFINE("FS_BOLD",9002);
DEFINE("FS_ITALIC",9003);
DEFINE("FS_BOLDIT",9004);
DEFINE("FS_BOLDITALIC",9004);
//Definitions for internal font, new style
DEFINE("FF_FONT0",1);
DEFINE("FF_FONT1",2);
DEFINE("FF_FONT2",4);
// 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);
//
// Get hold of gradient class (In Version 2.x)
// A client of the library has to manually include this
//
require_once 'jpgraph_gradient.php';
class ErrMsgText {
var $lt=NULL;
var $supportedLocales = array('en');
function ErrMsgText() {
GLOBAL $__jpg_err_locale;
if( !in_array($__jpg_err_locale,$this->supportedLocales) )
$aLoc = 'en';
require_once('lang/'.$__jpg_err_locale.'.inc.php');
$this->lt = $_jpg_messages;
}
function Get($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) {
if( !isset($this->lt[$errnbr]) ) {
return 'Internal error: The specified error message does not exist in the chosen locale. (Please blame the translator...))';
}
$ea = $this->lt[$errnbr];
$j=0;
if( $a1 !== null ) {
$argv[$j++] = $a1;
if( $a2 !== null ) {
$argv[$j++] = $a2;
if( $a3 !== null ) {
$argv[$j++] = $a3;
if( $a4 !== null ) {
$argv[$j++] = $a4;
if( $a5 !== null ) {
$argv[$j++] = $a5;
}
}
}
}
}
$numargs = $j;
if( $ea[1] != $numargs ) {
// Error message argument count do not match.
// Just return the error message without arguments.
return $ea[0];
}
switch( $numargs ) {
case 1:
$msg = sprintf($ea[0],$argv[0]);
break;
case 2:
$msg = sprintf($ea[0],$argv[0],$argv[1]);
break;
case 3:
$msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2]);
break;
case 4:
$msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3]);
break;
case 5:
$msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3],$argv[4]);
break;
case 0:
default:
$msg = sprintf($ea[0]);
break;
}
return $msg;
}
}
//
// A wrapper class that is used to access the specified error object
// (to hide the global error parameter and avoid having a GLOBAL directive
// in all methods.
//
GLOBAL $__jpg_err;
GLOBAL $__jpg_err_locale ;
$__jpg_err_locale = 'en';
class JpGraphError {
function Install($aErrObject) {
GLOBAL $__jpg_err;
$__jpg_err = $aErrObject;
}
function Raise($aMsg,$aHalt=true){
GLOBAL $__jpg_err;
$tmp = new $__jpg_err;
$tmp->Raise($aMsg,$aHalt);
}
function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) {
GLOBAL $__jpg_err;
$t = new ErrMsgText();
$msg = $t->Get($errnbr,$a1,$a2,$a3,$a4,$a5);
$tmp = new $__jpg_err;
$t
没有合适的资源?快使用搜索试试~ 我知道了~
JPgraph 类库
共1524个文件
html:924个
php:361个
png:209个
5星 · 超过95%的资源 需积分: 7 109 下载量 36 浏览量
2008-12-10
17:28:16
上传
评论 3
收藏 4.63MB RAR 举报
温馨提示
jpgraph PHP画图工具,非常方便实用的工具
资源推荐
资源详情
资源评论
收起资源包目录
JPgraph 类库 (1524个子文件)
CHANGELOG 39KB
de_normal.css 3KB
jpgmanual.css 3KB
flags.dat 952KB
flags_thumb100x100.dat 668KB
flags_thumb60x60.dat 365KB
flags_thumb35x35.dat 208KB
tiger_bkg.gif 19KB
manual_jpgraph.html 520KB
GTextTable.html 174KB
Graph.html 172KB
class_toc.html 88KB
Axis.html 77KB
Text.html 66KB
PiePlot.html 54KB
Shape.html 50KB
Legend.html 43KB
PlotMark.html 43KB
canvas_jpgarchex.html 40KB
CanvasRectangleText.html 38KB
GanttGraph.html 38KB
RadarGraph.html 34KB
BarPlot.html 29KB
105SampleapplicationDrawingDBschema.html 28KB
HeaderProperty.html 28KB
LinePlot.html 28KB
PiePlot3D.html 27KB
PolarAxis.html 26KB
Ticks.html 26KB
DisplayValue.html 25KB
GanttActivityInfo.html 24KB
Image.html 23KB
PolarGraph.html 23KB
DateLocale.html 22KB
dbschemaex1.html 21KB
toc.html 21KB
index.html 21KB
listfontsex1.html 20KB
gantthourminex1.html 18KB
SuperScriptText.html 18KB
IconPlot.html 18KB
GanttBar.html 18KB
gantticonex1.html 18KB
PlotBand.html 17KB
104Usingacanvasscale.html 17KB
GraphTabTitle.html 17KB
PieGraph.html 17KB
PiePlotC.html 17KB
bar_csimex3.html 16KB
textalignex1.html 16KB
ganttex12.html 16KB
barlinefreq_csimex1.html 16KB
CanvasGraph.html 16KB
ganttex10.html 15KB
ganttex11.html 15KB
CanvasScale.html 15KB
PolarPlot.html 15KB
RadarPlot.html 15KB
horizbarex3.html 15KB
LinearTicks.html 15KB
fieldscatterex1.html 15KB
loglogex1.html 15KB
Plot.html 14KB
7102Specifyingadatetimescalewithamanualcallback.html 14KB
PlotLine.html 14KB
GanttScale.html 14KB
RotImage.html 14KB
GanttPlotObject.html 14KB
TextProperty.html 14KB
93AsimpleGanttchart.html 14KB
impulsex4.html 14KB
Grid.html 13KB
ganttex19.html 13KB
ganttex18.html 13KB
71Lineplots.html 13KB
ganttex17.html 12KB
titlecsimex01.html 12KB
alphabarex1.html 12KB
gantthgridex1.html 12KB
piec_csimex1.html 12KB
FieldPlot.html 12KB
LinearScale.html 11KB
StockPlot.html 11KB
polarex9.html 11KB
staticbandbarex7.html 11KB
ganttex09.html 11KB
gradbkgex1.html 11KB
FuncGenerator.html 11KB
ganttex16.html 11KB
ganttex08.html 11KB
builtinplotmarksex1.html 11KB
funcex1.html 11KB
horizbarex2.html 11KB
7101Usingtheautomaticdatetimescale.html 11KB
103Addinglinesandrectanglestoacanvas.html 11KB
polarex7-2.html 11KB
GanttVLine.html 10KB
gantthourex1.html 10KB
inyaxisex2.html 10KB
Bezier.html 10KB
共 1524 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
- 回首郑板桥2012-06-02嗯,还在学习是怎么用的,全英文……
- cncqw2014-09-13请问怎么配置,好像使用不了。
tomiming
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功