本文整理汇总了PHP中JpGraphError::RaiseL方法的典型用法代码示例。如果您正苦于以下问题:PHP JpGraphError::RaiseL方法的具体用法?PHP JpGraphError::RaiseL怎么用?PHP JpGraphError::RaiseL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JpGraphError
的用法示例。
在下文中一共展示了JpGraphError::RaiseL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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];
}
示例3: 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;
}
示例4: 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.
}
}
示例5: 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;
}
示例6: 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]));
}
示例7: 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;
}
}
示例8: 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;
}
示例9: 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;
}
示例10: __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;
}
示例11: 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);
}
示例12: __get
function __get($name)
{
if (strpos($name, 'raw_') !== false) {
// if $name == 'raw_left_margin' , return $this->_left_margin;
$variable_name = '_' . str_replace('raw_', '', $name);
return $this->{$variable_name};
}
$variable_name = '_' . $name;
if (isset($this->{$variable_name})) {
return $this->{$variable_name} * SUPERSAMPLING_SCALE;
} else {
JpGraphError::RaiseL('25132', $name);
}
}
示例13: Stroke
function Stroke($img, $xscale, $yscale)
{
$n = $this->numpoints;
if ($this->center) {
$n--;
}
if (isset($this->coords[1])) {
if (count($this->coords[1]) != $n) {
JpGraphError::RaiseL(2003, count($this->coords[1]), $n);
// ("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;
}
$ts = $this->iTupleSize;
$this->csimareas = '';
for ($i = 0; $i < $n; ++$i) {
//If value is NULL, then don't draw a bar at all
if ($this->coords[0][$i * $ts] === null) {
continue;
}
if ($exist_x) {
$x = $this->coords[1][$i];
if ($x === null) {
continue;
}
} else {
$x = $i;
}
$xt = $xscale->Translate($x);
$neg = $this->coords[0][$i * $ts] > $this->coords[0][$i * $ts + 1];
$yopen = $yscale->Translate($this->coords[0][$i * $ts]);
$yclose = $yscale->Translate($this->coords[0][$i * $ts + 1]);
$ymin = $yscale->Translate($this->coords[0][$i * $ts + 2]);
$ymax = $yscale->Translate($this->coords[0][$i * $ts + 3]);
$dx = floor($this->iWidth / 2);
$xl = $xt - $dx;
$xr = $xt + $dx;
if ($neg) {
$img->SetColor($this->iStockColor3);
} else {
$img->SetColor($this->iStockColor1);
}
$img->FilledRectangle($xl, $yopen, $xr, $yclose);
$img->SetLineWeight($this->weight);
if ($neg) {
$img->SetColor($this->iStockColor2);
} else {
$img->SetColor($this->color);
}
$img->Rectangle($xl, $yopen, $xr, $yclose);
if ($yopen < $yclose) {
$ytop = $yopen;
$ybottom = $yclose;
} else {
$ytop = $yclose;
$ybottom = $yopen;
}
$img->SetColor($this->color);
$img->Line($xt, $ytop, $xt, $ymax);
$img->Line($xt, $ybottom, $xt, $ymin);
if ($this->iEndLines) {
$img->Line($xl, $ymax, $xr, $ymax);
$img->Line($xl, $ymin, $xr, $ymin);
}
// A chance for subclasses to add things to the bar
// for data point i
$this->ModBox($img, $xscale, $yscale, $i, $xl, $xr, $neg);
// Setup image maps
if (!empty($this->csimtargets[$i])) {
$this->csimareas .= '<area shape="rect" coords="' . round($xl) . ',' . round($ytop) . ',' . round($xr) . ',' . round($ybottom) . '" ';
$this->csimareas .= ' href="' . $this->csimtargets[$i] . '"';
if (!empty($this->csimalts[$i])) {
$sval = $this->csimalts[$i];
$this->csimareas .= " title=\"{$sval}\" alt=\"{$sval}\" ";
}
$this->csimareas .= " />\n";
}
}
return true;
}
示例14: SetOrientation
function SetOrientation($aDirection = 0)
{
if (is_numeric($aDirection)) {
$this->dir = $aDirection;
} elseif ($aDirection == "h") {
$this->dir = 0;
} elseif ($aDirection == "v") {
$this->dir = 90;
} else {
JpGraphError::RaiseL(25051);
}
//(" Invalid direction specified for text.");
}
示例15: FilledRectangle
//.........这里部分代码省略.........
$adj = 1.4;
$m = ($adj - 1.0) * (255 - min(255, min($from_color[0], min($from_color[1], $from_color[2]))));
$from_color = array(min(255, $from_color[0] + $m), min(255, $from_color[1] + $m), min(255, $from_color[2] + $m));
$steps = abs($xr - $xl) - $steps1 - $steps2;
$this->GetColArray($to_color, $from_color, $steps, $colors, $this->numcolors);
$n = count($colors);
for ($i = 0; $i < $steps && $i < $n; ++$i) {
$this->img->current_color = $colors[$i];
$this->img->Line($x, $yb, $x, $yt);
$x += $delta;
}
break;
case GRAD_CENTER:
$steps = ceil(min($yb - $yt + 1, $xr - $xl + 1) / 2);
$this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
$dx = ($xr - $xl) / 2;
$dy = ($yb - $yt) / 2;
$x = $xl;
$y = $yt;
$x2 = $xr;
$y2 = $yb;
$n = count($colors);
for ($x = $xl, $i = 0; $x < $xl + $dx && $y < $yt + $dy && $i < $n; ++$x, ++$y, --$x2, --$y2, ++$i) {
$this->img->current_color = $colors[$i];
$this->img->Rectangle($x, $y, $x2, $y2);
}
$this->img->Line($x, $y, $x2, $y2);
break;
case GRAD_RAISED_PANEL:
// right to left
$steps1 = $xr - $xl;
$delta = $xr >= $xl ? 1 : -1;
$this->GetColArray($to_color, $from_color, $steps1, $colors, $this->numcolors);
$n = count($colors);
for ($x = $xl, $i = 0; $i < $steps1 && $i < $n; ++$i) {
$this->img->current_color = $colors[$i];
$this->img->Line($x, $yb, $x, $yt);
$x += $delta;
}
// left to right
$xr -= 3;
$xl += 3;
$yb -= 3;
$yt += 3;
$steps2 = $xr - $xl;
$delta = $xr >= $xl ? 1 : -1;
for ($x = $xl, $j = $steps2; $j >= 0; --$j) {
$this->img->current_color = $colors[$j];
$this->img->Line($x, $yb, $x, $yt);
$x += $delta;
}
break;
case GRAD_DIAGONAL:
// use the longer dimension to determine the required number of steps.
// first loop draws from one corner to the mid-diagonal and the second
// loop draws from the mid-diagonal to the opposing corner.
if ($xr - $xl > $yb - $yt) {
// width is greater than height -> use x-dimension for steps
$steps = $xr - $xl;
$delta = $xr >= $xl ? 1 : -1;
$this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
$n = count($colors);
for ($x = $xl, $i = 0; $i < $steps && $i < $n; ++$i) {
$this->img->current_color = $colors[$i];
$y = $yt + $i / $steps * ($yb - $yt) * $delta;
$this->img->Line($x, $yt, $xl, $y);
$x += $delta;
}
for ($x = $xl, $i = 0; $i < $steps && $i < $n; ++$i) {
$this->img->current_color = $colors[$steps + $i];
$y = $yt + $i / $steps * ($yb - $yt) * $delta;
$this->img->Line($x, $yb, $xr, $y);
$x += $delta;
}
} else {
// height is greater than width -> use y-dimension for steps
$steps = $yb - $yt;
$delta = $yb >= $yt ? 1 : -1;
$this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
$n = count($colors);
for ($y = $yt, $i = 0; $i < $steps && $i < $n; ++$i) {
$this->img->current_color = $colors[$i];
$x = $xl + $i / $steps * ($xr - $xl) * $delta;
$this->img->Line($x, $yt, $xl, $y);
$y += $delta;
}
for ($y = $yt, $i = 0; $i < $steps && $i < $n; ++$i) {
$this->img->current_color = $colors[$steps + $i];
$x = $xl + $i / $steps * ($xr - $xl) * $delta;
$this->img->Line($x, $yb, $xr, $y);
$x += $delta;
}
}
break;
default:
JpGraphError::RaiseL(7001, $style);
//("Unknown gradient style (=$style).");
break;
}
}