本文整理汇总了PHP中JpGraphError类的典型用法代码示例。如果您正苦于以下问题:PHP JpGraphError类的具体用法?PHP JpGraphError怎么用?PHP JpGraphError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JpGraphError类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: mydie
function mydie($errno, $errstr = '', $errfile = '', $errline = '')
{
global $conf;
$jpgraph = $conf->get_conf('jpgraph_path');
include_once "{$jpgraph}/jpgraph.php";
$err = $errstr ? $errstr : $errno;
if ($errfile) {
switch ($errno) {
case 1:
$errprefix = 'Error';
break;
case 2:
$errprefix = 'Warning';
break;
case 8:
$errprefix = 'Notice';
break;
default:
return;
// dont show E_STRICT errors
}
$err = "{$errprefix}: {$err} in '{$errfile}' line {$errline}";
}
$error = new JpGraphError();
$error->Raise($err);
echo "{$err}";
exit;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:28,代码来源:draw_rrd.php
示例2: Stroke
function Stroke(&$img, &$xscale, &$yscale)
{
$numpoints = count($this->coords[0]) / 2;
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
if (isset($this->coords[1])) {
if (count($this->coords[1]) != $numpoints) {
JpGraphError::Raise("Number of X and Y points are not equal. Number of X-points:" . count($this->coords[1]) . " Number of Y-points:{$numpoints}");
} else {
$exist_x = true;
}
} else {
$exist_x = false;
}
if ($exist_x) {
$xs = $this->coords[1][0];
} else {
$xs = 0;
}
for ($i = 0; $i < $numpoints; ++$i) {
if ($exist_x) {
$x = $this->coords[1][$i];
} else {
$x = $i;
}
$xt = $xscale->Translate($x);
$yt1 = $yscale->Translate($this->coords[0][$i * 2]);
$yt2 = $yscale->Translate($this->coords[0][$i * 2 + 1]);
$img->Line($xt, $yt1, $xt, $yt2);
$img->Line($xt - $this->errwidth, $yt1, $xt + $this->errwidth, $yt1);
$img->Line($xt - $this->errwidth, $yt2, $xt + $this->errwidth, $yt2);
}
return true;
}
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:34,代码来源:jpgraph_error.php
示例3: __construct
public function __construct($errcode, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
{
// make sure everything is assigned properly
$errtxt = new ErrMsgText();
JpGraphError::SetTitle('JpGraph Error: ' . $errcode);
parent::__construct($errtxt->Get($errcode, $a1, $a2, $a3, $a4, $a5), 0);
}
开发者ID:amenadiel,项目名称:jpgraph,代码行数:7,代码来源:JpGraphExceptionL.php
示例4: GetCodewords
function GetCodewords($aData, $aLevel = 1)
{
$n = count($aData);
if ($n == 0) {
JpGraphError::RaiseL(25014);
}
//'No data to calculate codewords on.');
$k = 1 << $aLevel + 1;
$ck = array();
$m = 929;
for ($i = 0; $i < $k; ++$i) {
$ck[$i] = 0;
}
$t1 = $t2 = 0;
for ($i = 0; $i < $n; ++$i) {
$t1 = ($aData[$i] + $ck[$k - 1]) % $m;
for ($j = $k - 1; $j > 0; --$j) {
$t2 = $t1 * $this->iPolCoeff[$aLevel][$j] % $m;
$ck[$j] = ($ck[$j - 1] + ($m - $t2)) % $m;
}
$t2 = $t1 * $this->iPolCoeff[$aLevel][0] % $m;
$ck[0] = ($m - $t2) % $m;
}
for ($i = 0; $i < $k; ++$i) {
if ($ck[$i] > 0) {
$ck[$i] = $m - $ck[$i];
}
}
return array_reverse($ck);
}
开发者ID:rebuy-de,项目名称:jpgraph,代码行数:30,代码来源:pdf417_error.inc.php
示例5: GetPattern
function GetPattern($aRow, $aCodeVal)
{
if (empty($this->iPatterns[$aRow % 3 * 3][$aCodeVal])) {
JpGraphError::RaiseL(26007, $aCodeVal, $aRow);
}
//"GetPattern: Illegal Code Value = $aCodeVal (row=$aRow)\n\n");
return $this->iPatterns[$aRow % 3 * 3][$aCodeVal];
}
开发者ID:rebuy-de,项目名称:jpgraph,代码行数:8,代码来源:pdf417_clusters.inc.php
示例6: SetType
function SetType($aType, $aFileName = '', $aScale = 1.0)
{
$this->type = $aType;
if ($aType == MARK_IMG && $aFileName == '') {
JpGraphError::RaiseL(23003);
}
$this->iFileName = $aFileName;
$this->iScale = $aScale;
}
开发者ID:natanoj,项目名称:nuBuilderPro,代码行数:9,代码来源:jpgraph_plotmark.inc.php
示例7: ScatterPlot
function ScatterPlot(&$datay, $datax = false)
{
if (count($datax) != count($datay) && is_array($datax)) {
JpGraphError::Raise("Scatterplot must have equal number of X and Y points.");
}
$this->Plot($datay, $datax);
$this->mark = new PlotMark();
$this->mark->SetType(MARK_CIRCLE);
$this->mark->SetColor($this->color);
}
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:10,代码来源:jpgraph_scatter.php
示例8: execute
function execute()
{
$this->set_title($this->lang->stats);
$this->tree($this->lang->stats);
include '../lib/jpgraph/jpgraph.php';
include '../lib/jpgraph/jpgraph_bar.php';
if (!defined('IMG_PNG')) {
JpGraphError::Raise("This PHP installation is not configured with PNG support. Please recompile PHP with GD and JPEG support to run JpGraph. (Constant IMG_PNG does not exist)");
}
/**
* Posts
*/
$query = $this->db->query("SELECT COUNT(post_id) AS posts, FROM_UNIXTIME(post_time, '%%b %%y') AS month\n\t\t\tFROM %pposts GROUP BY month\tORDER BY post_time");
$data = array();
while ($item = $this->db->nqfetch($query)) {
$data[$item['month']] = $item['posts'];
}
if (!$data) {
$data = array(0, 0);
}
$graph = new Graph(400, 300, 'auto');
$graph->SetScale('textint');
$graph->SetColor('aliceblue');
$graph->SetMarginColor('white');
$graph->xaxis->SetTickLabels(array_keys($data));
$graph->yaxis->scale->SetGrace(20);
$graph->title->Set($this->lang->stats_post_by_month);
$temp = array_values($data);
$barplot = new BarPlot($temp);
$barplot->SetFillColor('darkorange');
$graph->add($barplot);
$graph->Stroke("../stats/{$this->time}1.png");
/**
* Registrations
*/
$query = $this->db->query("SELECT COUNT(user_id) AS users, FROM_UNIXTIME(user_joined, '%%b %%y') AS month\n\t\t\tFROM %pusers\n\t\t\tWHERE user_joined != 0\n\t\t\tGROUP BY month\n\t\t\tORDER BY user_joined");
$data = array();
while ($item = $this->db->nqfetch($query)) {
$data[$item['month']] = $item['users'];
}
$graph = new Graph(400, 300, 'auto');
$graph->SetScale('textint');
$graph->SetColor('aliceblue');
$graph->SetMarginColor('white');
$graph->xaxis->SetTickLabels(array_keys($data));
$graph->yaxis->scale->SetGrace(20);
$graph->title->Set($this->lang->stats_reg_by_month);
$temp = array_values($data);
$barplot = new BarPlot($temp);
$barplot->SetFillColor('darkorange');
$graph->add($barplot);
$graph->Stroke("../stats/{$this->time}2.png");
return $this->message($this->lang->stats, "<img src='../stats/{$this->time}1.png' alt='{$this->lang->stats_post_by_month}' /><br /><br />\n\t\t<img src='../stats/{$this->time}2.png' alt='{$this->lang->stats_reg_by_month}' />");
}
开发者ID:BackupTheBerlios,项目名称:qsf-svn,代码行数:54,代码来源:stats.php
示例9: Translate
function Translate($a)
{
if ($a < 0) {
JpGraphError::Raise("Negative data values can not be used in a log scale.");
exit(1);
}
if ($a == 0) {
$a = 1;
}
$a = log10($a);
return floor($this->off + ($a * 1.0 - $this->scale[0]) * $this->scale_factor);
}
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:12,代码来源:jpgraph_log.php
示例10: Stroke
public function Stroke()
{
if (JpGraphError::GetImageFlag()) {
$errobj = new JpGraphErrObjectImg();
$errobj->SetTitle(JpGraphError::GetTitle());
} else {
$errobj = new JpGraphErrObject();
$errobj->SetTitle(JpGraphError::GetTitle());
$errobj->SetStrokeDest(JpGraphError::GetLogFile());
}
$errobj->Raise($this->getMessage());
}
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:12,代码来源:JpGraphException.php
示例11: ApplyGraph
/**
*
*/
function ApplyGraph($graph)
{
$this->graph = $graph;
$method_name = '';
if (get_class($graph) == 'Graph') {
$method_name = 'SetupGraph';
} else {
$method_name = 'Setup' . get_class($graph);
}
if (method_exists($this, $method_name)) {
$this->{$method_name}($graph);
} else {
JpGraphError::RaiseL(30001, $method_name, $method_name);
//Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.
}
}
开发者ID:hcvcastro,项目名称:pxp,代码行数:19,代码来源:jpgraph_theme.inc.php
示例12: File
function File($family, $style = FS_NORMAL)
{
$fam = @$this->font_files[$family];
if (!$fam) {
JpGraphError::RaiseL(25046, $family);
//("Specified TTF font family (id=$family) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/");
}
$ff = @$fam[$style];
// There are several optional file names. They are tried in order
// and the first one found is used
if (!is_array($ff)) {
$ff = array($ff);
}
$jpgraph_font_dir = dirname(__FILE__) . '/fonts/';
foreach ($ff as $font_file) {
// All font families are guaranteed to have the normal style
if ($font_file === '') {
JpGraphError::RaiseL(25047, $this->style_names[$style], $this->font_files[$family][FS_NORMAL]);
}
//('Style "'.$this->style_names[$style].'" is not available for font family '.$this->font_files[$family][FS_NORMAL].'.');
if (!$font_file) {
JpGraphError::RaiseL(25048, $fam);
//("Unknown font style specification [$fam].");
}
// check jpgraph/src/fonts dir
$jpgraph_font_file = $jpgraph_font_dir . $font_file;
if (file_exists($jpgraph_font_file) === true && is_readable($jpgraph_font_file) === true) {
$font_file = $jpgraph_font_file;
break;
}
// check OS font dir
if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) {
$font_file = MBTTF_DIR . $font_file;
} else {
$font_file = TTF_DIR . $font_file;
}
if (file_exists($font_file) === true && is_readable($font_file) === true) {
break;
}
}
if (!file_exists($font_file)) {
JpGraphError::RaiseL(25049, $font_file);
//("Font file \"$font_file\" is not readable or does not exist.");
}
return $font_file;
}
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:46,代码来源:TTF.php
示例13: GetImg
function GetImg($aMark, $aIdx)
{
$n = $this->an[$aMark];
if (is_string($aIdx)) {
if (!in_array($aIdx, $this->colors)) {
JpGraphError::RaiseL(23001, $this->name, $aIdx);
//('This marker "'.($this->name).'" does not exist in color: '.$aIdx);
}
$idx = $this->index[$aIdx];
} elseif (!is_integer($aIdx) || is_integer($aIdx) && $aIdx > $this->maxidx) {
JpGraphError::RaiseL(23002, $this->name);
//('Mark color index too large for marker "'.($this->name).'"');
} else {
$idx = $aIdx;
}
return Image::CreateFromString(base64_decode($this->{$n}[$idx][1]));
}
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:17,代码来源:ImgData.php
示例14: Convert
public function Convert($aTxt, $aFF)
{
if (LANGUAGE_GREEK) {
if (GREEK_FROM_WINDOWS) {
$unistring = LanguageConv::gr_win2uni($aTxt);
} else {
$unistring = LanguageConv::gr_iso2uni($aTxt);
}
return $unistring;
} elseif (LANGUAGE_CYRILLIC) {
if (CYRILLIC_FROM_WINDOWS && (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'windows-1251'))) {
$aTxt = convert_cyr_string($aTxt, "w", "k");
}
if (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'koi8-r') || stristr(LANGUAGE_CHARSET, 'windows-1251')) {
$isostring = convert_cyr_string($aTxt, "k", "i");
$unistring = LanguageConv::iso2uni($isostring);
} else {
$unistring = $aTxt;
}
return $unistring;
} elseif ($aFF === FF_SIMSUN) {
// Do Chinese conversion
if ($this->g2312 == null) {
include_once 'jpgraph_gb2312.php';
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
} elseif ($aFF === FF_BIG5) {
if (!function_exists('iconv')) {
JpGraphError::RaiseL(25006);
//('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
}
return iconv('BIG5', 'UTF-8', $aTxt);
} elseif (ASSUME_EUCJP_ENCODING && ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC)) {
if (!function_exists('mb_convert_encoding')) {
JpGraphError::RaiseL(25127);
}
return mb_convert_encoding($aTxt, 'UTF-8', 'EUC-JP');
} elseif ($aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON) {
return LanguageConv::heb_iso2uni($aTxt);
} else {
return $aTxt;
}
}
开发者ID:amenadiel,项目名称:jpgraph,代码行数:44,代码来源:LanguageConv.php
示例15: Bezier
function Bezier($datax, $datay, $attraction_factor = 1)
{
$this->n = count($datax);
if ($this->n !== count($datay)) {
JpGraphError::RaiseL(19003);
}
$idx = 0;
foreach ($datax as $datumx) {
for ($i = 0; $i < $attraction_factor; $i++) {
$this->datax[$idx++] = $datumx;
}
}
$idx = 0;
foreach ($datay as $datumy) {
for ($i = 0; $i < $attraction_factor; $i++) {
$this->datay[$idx++] = $datumy;
}
}
$this->n *= $attraction_factor;
}
开发者ID:natanoj,项目名称:nuBuilderPro,代码行数:20,代码来源:jpgraph_regstat.php
示例16: Set
public function Set($aLocale)
{
if (in_array($aLocale, array_keys($this->iDayAbb))) {
$this->iLocale = $aLocale;
return true;
// already cached nothing else to do!
}
$pLocale = setlocale(LC_TIME, 0);
// get current locale for LC_TIME
if (is_array($aLocale)) {
foreach ($aLocale as $loc) {
$res = @setlocale(LC_TIME, $loc);
if ($res) {
$aLocale = $loc;
break;
}
}
} else {
$res = @setlocale(LC_TIME, $aLocale);
}
if (!$res) {
JpGraphError::RaiseL(25007, $aLocale);
//("You are trying to use the locale ($aLocale) which your PHP installation does not support. Hint: Use '' to indicate the default locale for this geographic region.");
return false;
}
$this->iLocale = $aLocale;
for ($i = 0, $ofs = 0 - strftime('%w'); $i < 7; $i++, $ofs++) {
$day = strftime('%a', strtotime("{$ofs} day"));
$day[0] = strtoupper($day[0]);
$this->iDayAbb[$aLocale][] = $day[0];
$this->iShortDay[$aLocale][] = $day;
}
for ($i = 1; $i <= 12; ++$i) {
list($short, $full) = explode('|', strftime("%b|%B", strtotime("2001-{$i}-01")));
$this->iShortMonth[$aLocale][] = ucfirst($short);
$this->iMonthName[$aLocale][] = ucfirst($full);
}
setlocale(LC_TIME, $pLocale);
return true;
}
开发者ID:amenadiel,项目名称:jpgraph,代码行数:40,代码来源:DateLocale.php
示例17: E
public function E($aXMin, $aXMax, $aSteps = 50)
{
$this->iMin = $aXMin;
$this->iMax = $aXMax;
$this->iStepSize = ($aXMax - $aXMin) / $aSteps;
if ($this->iXFunc != '') {
$t = 'for($i=' . $aXMin . '; $i<=' . $aXMax . '; $i += ' . $this->iStepSize . ') {$ya[]=' . $this->iFunc . ';$xa[]=' . $this->iXFunc . ';}';
} elseif ($this->iFunc != '') {
$t = 'for($x=' . $aXMin . '; $x<=' . $aXMax . '; $x += ' . $this->iStepSize . ') {$ya[]=' . $this->iFunc . ';$xa[]=$x;} $x=' . $aXMax . ';$ya[]=' . $this->iFunc . ';$xa[]=$x;';
} else {
JpGraphError::RaiseL(24001);
}
//('FuncGenerator : No function specified. ');
@eval($t);
// If there is an error in the function specifcation this is the only
// way we can discover that.
if (empty($xa) || empty($ya)) {
JpGraphError::RaiseL(24002);
}
//('FuncGenerator : Syntax error in function specification ');
return array($xa, $ya);
}
开发者ID:amenadiel,项目名称:jpgraph,代码行数:22,代码来源:FuncGenerator.php
示例18: __construct
public function __construct($datax, $datay, $attraction_factor = 1)
{
// Adding control point multiple time will raise their attraction power over the curve
$this->n = count($datax);
if ($this->n !== count($datay)) {
JpGraphError::RaiseL(19003);
//('Bezier: Number of X and Y coordinates must be the same');
}
$idx = 0;
foreach ($datax as $datumx) {
for ($i = 0; $i < $attraction_factor; $i++) {
$this->datax[$idx++] = $datumx;
}
}
$idx = 0;
foreach ($datay as $datumy) {
for ($i = 0; $i < $attraction_factor; $i++) {
$this->datay[$idx++] = $datumy;
}
}
$this->n *= $attraction_factor;
}
开发者ID:amenadiel,项目名称:jpgraph,代码行数:22,代码来源:Bezier.php
示例19: Stroke
function Stroke($aImg)
{
if ($this->iFile != '' && $this->iCountryFlag != '') {
JpGraphError::Raise('It is not possible to specify both an image file and a country flag for the same icon.');
}
if ($this->iFile != '') {
$gdimg = Graph::LoadBkgImage('', $this->iFile);
} else {
if (!class_exists('FlagImages')) {
JpGraphError::Raise('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.');
}
$fobj = new FlagImages($this->iCountryStdSize);
$dummy = '';
$gdimg = $fobj->GetImgByName($this->iCountryFlag, $dummy);
}
if ($this->iX >= 0 && $this->iX <= 1.0) {
$w = imagesx($aImg->img);
$this->iX = round($w * $this->iX);
}
if ($this->iY >= 0 && $this->iY <= 1.0) {
$h = imagesy($aImg->img);
$this->iY = round($h * $this->iY);
}
$iconw = imagesx($gdimg);
$iconh = imagesy($gdimg);
if ($this->iHorAnchor == 'center') {
$this->iX -= round($iconw * $this->iScale / 2);
}
if ($this->iHorAnchor == 'right') {
$this->iX -= round($iconw * $this->iScale);
}
if ($this->iVertAnchor == 'center') {
$this->iY -= round($iconh * $this->iScale / 2);
}
if ($this->iVertAnchor == 'bottom') {
$this->iY -= round($iconh * $this->iScale);
}
$aImg->CopyMerge($gdimg, $this->iX, $this->iY, 0, 0, round($iconw * $this->iScale), round($iconh * $this->iScale), $iconw, $iconh, $this->iMix);
}
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:39,代码来源:jpgraph_iconplot.php
示例20: Interpolate
function Interpolate($xpoint)
{
$max = $this->n - 1;
$min = 0;
// Binary search to find interval
while ($max - $min > 1) {
$k = ($max + $min) / 2;
if ($this->xdata[$k] > $xpoint) {
$max = $k;
} else {
$min = $k;
}
}
// Each interval is interpolated by a 3:degree polynom function
$h = $this->xdata[$max] - $this->xdata[$min];
if ($h == 0) {
JpGraphError::Raise('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.');
}
$a = ($this->xdata[$max] - $xpoint) / $h;
$b = ($xpoint - $this->xdata[$min]) / $h;
return $a * $this->ydata[$min] + $b * $this->ydata[$max] + (($a * $a * $a - $a) * $this->y2[$min] + ($b * $b * $b - $b) * $this->y2[$max]) * ($h * $h) / 6.0;
}
开发者ID:johnfelipe,项目名称:orfeo,代码行数:22,代码来源:jpgraph_regstat.php
注:本文中的JpGraphError类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论