⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phpchartdir.php

📁 一个绝对棒的报表绘图软件
💻 PHP
📖 第 1 页 / 共 5 页
字号:
function defaultPalette() { global $defaultPalette; return $defaultPalette; }

$whiteOnBlackPalette = array(
	0x000000, 0xffffff, 0xffffff, 0x808080,
	0x808080, 0x808080, 0x808080, 0x808080,
	0xff0000, 0x00ff00, 0x0000ff, 0xffff00,
	0xff00ff, 0x66ffff,	0xffcc33, 0xcccccc,
	0x9966ff, 0x339966, 0x999900, 0xcc3300,
	0x99cccc, 0x006600, 0x660066, 0xcc9999,
	0xff9966, 0x99ff99, 0x9999ff, 0xcc6600,
	0x33cc33, 0xcc99ff, 0xff6666, 0x99cc66,
	0x009999, 0xcc3333, 0x9933ff, 0xff0000,
	0x0000ff, 0x00ff00, 0xffcc99, 0x999999,
	-1
);
function whiteOnBlackPalette() { global $whiteOnBlackPalette; return $whiteOnBlackPalette; }

$transparentPalette = array(
	0xffffff, 0x000000, 0x000000, 0x808080,
	0x808080, 0x808080, 0x808080, 0x808080,
	0x80ff0000, 0x8000ff00, 0x800000ff, 0x80ffff00,
	0x80ff00ff, 0x8066ffff,	0x80ffcc33, 0x80cccccc,
	0x809966ff, 0x80339966, 0x80999900, 0x80cc3300,
	0x8099cccc, 0x80006600, 0x80660066, 0x80cc9999,
	0x80ff9966, 0x8099ff99, 0x809999ff, 0x80cc6600,
	0x8033cc33, 0x80cc99ff, 0x80ff6666, 0x8099cc66,
	0x80009999, 0x80cc3333, 0x809933ff, 0x80ff0000,
	0x800000ff, 0x8000ff00, 0x80ffcc99, 0x80999999,
	-1
);
function transparentPalette() { global $transparentPalette; return $transparentPalette; }

define("NoSymbol", 0);
define("SquareSymbol", 1);
define("DiamondSymbol", 2);
define("TriangleSymbol", 3);
define("RightTriangleSymbol", 4);
define("LeftTriangleSymbol", 5);
define("InvertedTriangleSymbol", 6);
define("CircleSymbol", 7);
define("CrossSymbol", 8);
define("Cross2Symbol", 9);
define("PolygonSymbol", 11);
define("Polygon2Symbol", 12);
define("StarSymbol", 13);
define("CustomSymbol", 14);
	
define("NoShape", 0);
define("SquareShape", 1);
define("DiamondShape", 2);
define("TriangleShape", 3);
define("RightTriangleShape", 4);
define("LeftTriangleShape", 5);
define("InvertedTriangleShape", 6);
define("CircleShape", 7);
define("CircleShapeNoShading", 10);

function cdBound($a, $b, $c) {
	if ($b < $a)
		return $a;
	if ($b > $c)
		return $c;
	return $b;
}
	
function CrossShape($width = 0.5) {
	return CrossSymbol | (((int)(cdBound(0, $width, 1) * 4095 + 0.5)) << 12);
}
function Cross2Shape($width = 0.5) {
	return Cross2Symbol | (((int)(cdBound(0, $width, 1) * 4095 + 0.5)) << 12);
}
function PolygonShape($side) {
	return PolygonSymbol | (cdBound(0, $side, 100) << 12);
}
function Polygon2Shape($side) {
	return Polygon2Symbol | (cdBound(0, $side, 100) << 12);
}
function StarShape($side) {
	return StarSymbol | (cdBound(0, $side, 100) << 12);
}
	
define("DashLine", 0x0505);
define("DotLine", 0x0202);
define("DotDashLine", 0x05050205);
define("AltDashLine", 0x0A050505);

$goldGradient = array(0, 0xFFE743, 0x60, 0xFFFFE0, 0xB0, 0xFFF0B0, 0x100, 0xFFE743);
$silverGradient = array(0, 0xC8C8C8, 0x60, 0xF8F8F8, 0xB0, 0xE0E0E0, 0x100, 0xC8C8C8);
$redMetalGradient = array(0, 0xE09898, 0x60, 0xFFF0F0, 0xB0, 0xF0D8D8, 0x100, 0xE09898);
$blueMetalGradient = array(0, 0x9898E0, 0x60, 0xF0F0FF, 0xB0, 0xD8D8F0, 0x100, 0x9898E0);
$greenMetalGradient = array(0, 0x98E098, 0x60, 0xF0FFF0, 0xB0, 0xD8F0D8, 0x100, 0x98E098);
function goldGradient() { global $goldGradient; return $goldGradient; }
function silverGradient() { global $silverGradient; return $silverGradient; }
function redMetalGradient() { global $redMetalGradient; return $redMetalGradient; }
function blueMetalGradient() { global $blueMetalGradient; return $blueMetalGradient; }
function greenMetalGradient() { global $greenMetalGradient; return $greenMetalGradient; }

function metalColor($c, $angle = 90) {
	return callmethod("metalColor", $c, $angle);
}
function goldColor($angle = 90) {
	return metalColor(0xffee44, $angle);
}
function silverColor($angle = 90) {
	return metalColor(0xdddddd, $angle);
}

define("NormalLegend", 0);
define("ReverseLegend", 1);
define("NoLegend", 2);

define("SideLayout", 0);
define("CircleLayout", 1);

define("PixelScale", 0);
define("XAxisScale", 1);
define("YAxisScale", 2);
define("AngularAxisScale", XAxisScale);
define("RadialAxisScale", YAxisScale);

define("StartOfHourFilterTag", 1);
define("StartOfDayFilterTag", 2);
define("StartOfWeekFilterTag", 3);
define("StartOfMonthFilterTag", 4);
define("StartOfYearFilterTag", 5);
define("RegularSpacingFilterTag", 6);
define("AllPassFilterTag", 7);
define("NonePassFilterTag", 8);
define("SelectItemFilterTag", 9);

function StartOfHourFilter($labelStep = 1, $initialMargin = 0.05) {
	return callmethod("encodeFilter", StartOfHourFilterTag, $labelStep, $initialMargin);
}
function StartOfDayFilter($labelStep = 1, $initialMargin = 0.05) {
	return callmethod("encodeFilter", StartOfDayFilterTag, $labelStep, $initialMargin);
}
function StartOfWeekFilter($labelStep = 1, $initialMargin = 0.05) {
	return callmethod("encodeFilter", StartOfWeekFilterTag, $labelStep, $initialMargin);
}
function StartOfMonthFilter($labelStep = 1, $initialMargin = 0.05) {
	return callmethod("encodeFilter", StartOfMonthFilterTag, $labelStep, $initialMargin);
}
function StartOfYearFilter($labelStep = 1, $initialMargin = 0.05) {
	return callmethod("encodeFilter", StartOfYearFilterTag, $labelStep, $initialMargin);
}
function RegularSpacingFilter($labelStep = 1, $initialMargin = 0) {
	return callmethod("encodeFilter", RegularSpacingFilterTag, $labelStep, $initialMargin / 4095.0);
}
function AllPassFilter() {
	return callmethod("encodeFilter", AllPassFilterTag, 0, 0);
}
function NonePassFilter() {
	return callmethod("encodeFilter", NonePassFilterTag, 0, 0);
}
function SelectItemFilter($item) {
	return callmethod("encodeFilter", SelectItemFilterTag, $item, 0);
}
	
define("NormalGlare", 3);
define("ReducedGlare", 2);
define("NoGlare", 1);

function glassEffect($glareSize = NormalGlare, $glareDirection = Top, $raisedEffect = 5) {
	return callmethod("glassEffect", $glareSize, $glareDirection, $raisedEffect);
}
function softLighting($direction = Top, $raisedEffect = 4) {
	return callmethod("softLighting", $direction, $raisedEffect);
}

define("AggregateSum", 0);
define("AggregateAvg", 1);
define("AggregateStdDev", 2);
define("AggregateMin", 3);
define("AggregateMed", 4);
define("AggregateMax", 5);
define("AggregatePercentile", 6);
define("AggregateFirst", 7);
define("AggregateLast", 8);
define("AggregateCount", 9);
	
#///////////////////////////////////////////////////////////////////////////////////
#//	bindings to libgraphics.h
#///////////////////////////////////////////////////////////////////////////////////
class TTFText
{
	function TTFText($ptr) {
		$this->ptr = $ptr;
		autoDestroy($this);
	}
	function __del__() {
		callmethod("TTFText.destroy", $this->ptr);
	}
	function getWidth() {
		return callmethod("TTFText.getWidth", $this->ptr);
	}
	function getHeight() {
		return callmethod("TTFText.getHeight", $this->ptr);
	}
	function getLineHeight() {
		return callmethod("TTFText.getLineHeight", $this->ptr);
	}
	function getLineDistance() {
		return callmethod("TTFText.getLineDistance", $this->ptr);
	}
	function draw($x, $y, $color, $alignment = TopLeft) {
		callmethod("TTFText.draw", $this->ptr, $x, $y, $color, $alignment);
	}
}

class DrawArea {
	function DrawArea($ptr = Null) {
		if (is_null($ptr)) {
			$this->ptr = callmethod("DrawArea.create");
			autoDestroy($this);
		}
		else {
			$this->ptr = $ptr;
		}
	}
	function __del__() {
		callmethod("DrawArea.destroy", $this->ptr);
	}
	function setSize($width, $height, $bgColor = 0xffffff) {
		callmethod("DrawArea.setSize", $this->ptr, $width, $height, $bgColor);
	}
	function resize($newWidth, $newHeight, $f = LinearFilter, $blur = 1) {
		callmethod("DrawArea.resize", $this->ptr, $newWidth, $newHeight, $f, $blur);
	}
	function getWidth() {
		return callmethod("DrawArea.getWidth", $this->ptr);
	}
	function getHeight() {
		return callmethod("DrawArea.getHeight", $this->ptr);
	}
	function setClipRect($left, $top, $right, $bottom) {
		return callmethod("DrawArea.setClipRect", $this->ptr, $left, $top, $right, $bottom);
	}
	function setBgColor($c) {
		callmethod("DrawArea.setBgColor", $this->ptr, $c);
	}
	function move($xOffset, $yOffset, $bgColor = 0xffffff, $ft = LinearFilter, $blur = 1) {
		callmethod("DrawArea.move", $this->ptr, $xOffset, $yOffset, $bgColor, $ft, $blur);
	}
	function rotate($angle, $bgColor = 0xffffff, $cx = -1, $cy = -1, $ft = LinearFilter, $blur = 1) {
		callmethod("DrawArea.rotate", $this->ptr, $angle, $bgColor, $cx, $cy, $ft, $blur);
	}
	function hFlip() {
		callmethod("DrawArea.hFlip", $this->ptr);
	}
	function vFlip() {
		callmethod("DrawArea.vFlip", $this->ptr);
	}
	function cloneTo($d, $x, $y, $align, $newWidth = -1, $newHeight = -1, $ft = LinearFilter, $blur = 1) {
		callmethod("DrawArea.clone", $this->ptr, $d->ptr, $x, $y, $align, $newWidth, $newHeight, $ft, $blur);
	}
	
	function pixel($x, $y, $c) {
		callmethod("DrawArea.pixel", $this->ptr, $x, $y, $c);
	}
	function getPixel($x, $y) {
		return callmethod("DrawArea.getPixel", $this->ptr, $x, $y);
	}

	function hline($x1, $x2, $y, $c) {
		callmethod("DrawArea.hline", $this->ptr, $x1, $x2, $y, $c);
	}
	function vline($y1, $y2, $x, $c) {
		callmethod("DrawArea.vline", $this->ptr, $y1, $y2, $x, $c);
	}
	function line($x1, $y1, $x2, $y2, $c, $lineWidth = 1) {
		callmethod("DrawArea.line", $this->ptr, $x1, $y1, $x2, $y2, $c, $lineWidth);
	}
	function arc($cx, $cy, $rx, $ry, $a1, $a2, $c) {
		callmethod("DrawArea.arc", $this->ptr, $cx, $cy, $rx, $ry, $a1, $a2, $c);
	}

	function rect($x1, $y1, $x2, $y2, $edgeColor, $fillColor, $raisedEffect = 0) {
		callmethod("DrawArea.rect", $this->ptr, $x1, $y1, $x2, $y2, $edgeColor, $fillColor, $raisedEffect);
	}
	function polygon($points, $edgeColor, $fillColor) {
		$x = array();
		$y = array();
		reset($points);
		while (list(, $coor) = each($points)) {
			$x[] = $coor[0];
			$y[] = $coor[1];
		}
		callmethod("DrawArea.polygon", $this->ptr, $x, $y, $edgeColor, $fillColor);
	}
	function surface($x1, $y1, $x2, $y2, $depthX, $depthY, $edgeColor, $fillColor) {
		callmethod("DrawArea.surface", $this->ptr, $x1, $y1, $x2, $y2, $depthX, $depthY, $edgeColor, $fillColor);
	}
	function sector($cx, $cy, $rx, $ry, $a1, $a2, $edgeColor, $fillColor) {
		callmethod("DrawArea.sector", $this->ptr, $cx, $cy, $rx, $ry, $a1, $a2, $edgeColor, $fillColor);
	}
	function cylinder($cx, $cy, $rx, $ry, $a1, $a2, $depthX, $depthY, $edgeColor, $fillColor) {
		callmethod("DrawArea.cylinder", $this->ptr, $cx, $cy, $rx, $ry, $a1, $a2, $depthX, $depthY, $edgeColor, $fillColor);
	}
	function circle($cx, $cy, $rx, $ry, $edgeColor, $fillColor) {
		callmethod("DrawArea.circle", $this->ptr, $cx, $cy, $rx, $ry, $edgeColor, $fillColor);
	}
	function circleShape($cx, $cy, $rx, $ry, $edgeColor, $fillColor) {
		callmethod("DrawArea.circle", $this->ptr, $cx, $cy, $rx, $ry, $edgeColor, $fillColor);
	}

	function fill($x, $y, $color, $borderColor = Null) {
		if (is_null($borderColor))
			callmethod("DrawArea.fill", $this->ptr, $x, $y, $color);
		else
			$this->fill2($x, $y, $color, $borderColor);
	}
	function fill2($x, $y, $color, $borderColor) {
		callmethod("DrawArea.fill2", $this->ptr, $x, $y, $color, $borderColor);
	}

	function text($str, $font, $fontSize, $x, $y, $color) {
		callmethod("DrawArea.text", $this->ptr, $str, $font, $fontSize, $x, $y, $color);
	}
	function text2($str, $font, $fontIndex, $fontHeight, $fontWidth, $angle, $vertical, $x, $y, $color, $alignment = TopLeft) {
		callmethod("DrawArea.text2", $this->ptr, $str, $font, $fontIndex, $fontHeight, $fontWidth, $angle, $vertical, $x, $y, $color, $alignment);
	}
	function text3($str, $font, $fontSize) {
		return new TTFText(callmethod("DrawArea.text3", $this->ptr, $str, $font, $fontSize));
	}
	function text4($text, $font, $fontIndex, $fontHeight, $fontWidth, $angle, $vertical) {
		return new TTFText(callmethod("DrawArea.text4", $this->ptr, $text, $font, $fontIndex, $fontHeight, $fontWidth, $angle, $vertical));
	}

	function merge($d, $x, $y, $align, $transparency) {
		callmethod("DrawArea.merge", $this->ptr, $d->ptr, $x, $y, $align, $transparency);
	}
	function tile($d, $transparency) {
		callmethod("DrawArea.tile", $this->ptr, $d->ptr, $transparency);
	}

	function setSearchPath($path) {
		callmethod("DrawArea.setSearchPath", $this->ptr, $path);
	}
	function loadGIF($filename) {
		return callmethod("DrawArea.loadGIF", $this->ptr, $filename);
	}
	function loadPNG($filename) {
		return callmethod("DrawArea.loadPNG", $this->ptr, $filename);
	}
	function loadJPG($filename) {
		return callmethod("DrawArea.loadJPG", $this->ptr, $filename);
	}
	function loadWMP($filename) {
		return callmethod("DrawArea.loadWMP", $this->ptr, $filename);
	}
	function load($filename) {
		return callmethod("DrawArea.load", $this->ptr, $filename);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -