本文整理汇总了PHP中ImgTrans类的典型用法代码示例。如果您正苦于以下问题:PHP ImgTrans类的具体用法?PHP ImgTrans怎么用?PHP ImgTrans使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImgTrans类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Stroke
function Stroke($aStrokeFileName = "")
{
if ($this->texts != null) {
for ($i = 0; $i < count($this->texts); ++$i) {
$this->texts[$i]->Stroke($this->img);
}
}
if ($this->iTables !== null) {
for ($i = 0; $i < count($this->iTables); ++$i) {
$this->iTables[$i]->Stroke($this->img);
}
}
$this->StrokeTitles();
$_csim = $aStrokeFileName === _CSIM_SPECIALFILE;
$this->iHasStroked = true;
if (!$_csim) {
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
return true;
}
}
}
示例2: Stroke
function Stroke($aStrokeFileName = "")
{
if ($this->texts != null) {
for ($i = 0; $i < count($this->texts); ++$i) {
$this->texts[$i]->Stroke($this->img);
}
}
$this->StrokeTitles();
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
// If the filename is given as the special _IMG_HANDLER
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
return true;
}
}
示例3: Stroke
function Stroke($aStrokeFileName = "")
{
if ($this->texts != null) {
$textsCnt = count($this->texts);
for ($i = 0; $i < $textsCnt; ++$i) {
$this->texts[$i]->Stroke($this->img);
}
}
if ($this->iTables !== null) {
$iTablesCnt = count($this->iTables);
for ($i = 0; $i < $iTablesCnt; ++$i) {
$this->iTables[$i]->Stroke($this->img);
}
}
$this->StrokeTitles();
// If the filename is the predefined value = '_csim_special_'
// we assume that the call to stroke only needs to do enough
// to correctly generate the CSIM maps.
// We use this variable to skip things we don't strictly need
// to do to generate the image map to improve performance
// a best we can. Therefor you will see a lot of tests !$_csim in the
// code below.
$_csim = $aStrokeFileName === _CSIM_SPECIALFILE;
// We need to know if we have stroked the plot in the
// GetCSIMareas. Otherwise the CSIM hasn't been generated
// and in the case of GetCSIM called before stroke to generate
// CSIM without storing an image to disk GetCSIM must call Stroke.
$this->iHasStroked = true;
if (!$_csim) {
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans', false)) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
// If the filename is given as the special _IMG_HANDLER
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
return true;
}
}
}
示例4: Stroke
//.........这里部分代码省略.........
// Stroke all plots for Y1 axis
for ($i = 0; $i < count($this->plots); ++$i) {
$this->plots[$i]->Stroke($this->img, $this->xscale, $this->yscale);
$this->plots[$i]->StrokeMargin($this->img);
}
}
if ($this->iDoClipping) {
// Clipping only supports graphs at 0 and 90 degrees
if ($this->img->a == 0) {
$this->img->CopyCanvasH($oldimage, $this->img->img, $this->img->left_margin, $this->img->top_margin, $this->img->left_margin, $this->img->top_margin, $this->img->plotwidth + 1, $this->img->plotheight);
} elseif ($this->img->a == 90) {
$adj = ($this->img->height - $this->img->width) / 2;
$this->img->CopyCanvasH($oldimage, $this->img->img, $this->img->bottom_margin - $adj, $this->img->left_margin + $adj, $this->img->bottom_margin - $adj, $this->img->left_margin + $adj, $this->img->plotheight + 1, $this->img->plotwidth);
} else {
JpGraphError::Raise('You have enabled clipping. Cliping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (=' . $this->img->a . ' degrees) or disable clipping.');
}
$this->img->Destroy();
$this->img->SetCanvasH($oldimage);
}
$this->xscale->off = $oldoff;
if ($this->grid_depth == DEPTH_FRONT && !$_csim) {
$this->ygrid->Stroke();
$this->xgrid->Stroke();
}
// Stroke bands
if ($this->bands != null) {
for ($i = 0; $i < count($this->bands); ++$i) {
// Stroke all bands that asks to be in the foreground
if ($this->bands[$i]->depth == DEPTH_FRONT) {
$this->bands[$i]->Stroke($this->img, $this->xscale, $this->yscale);
}
}
}
if ($this->y2bands != null && $this->y2scale != null) {
for ($i = 0; $i < count($this->y2bands); ++$i) {
// Stroke all bands that asks to be in the foreground
if ($this->y2bands[$i]->depth == DEPTH_FRONT) {
$this->y2bands[$i]->Stroke($this->img, $this->xscale, $this->y2scale);
}
}
}
// Stroke any lines added
if ($this->lines != null) {
for ($i = 0; $i < count($this->lines); ++$i) {
$this->lines[$i]->Stroke($this->img, $this->xscale, $this->yscale);
}
}
if ($this->y2lines != null && $this->y2scale != null) {
for ($i = 0; $i < count($this->y2lines); ++$i) {
$this->y2lines[$i]->Stroke($this->img, $this->xscale, $this->y2scale);
}
}
// Finally draw the axis again since some plots may have nagged
// the axis in the edges.
if (!$_csim) {
$this->StrokeAxis();
}
if ($this->y2scale != null && !$_csim) {
$this->y2axis->Stroke($this->xscale);
}
if (!$_csim) {
$this->StrokePlotBox();
}
if (!$_csim) {
// The titles and legends never gets rotated so make sure
// that the angle is 0 before stroking them
$aa = $this->img->SetAngle(0);
$this->StrokeTitles();
$this->footer->Stroke($this->img);
}
$this->legend->Stroke($this->img);
if (!$_csim) {
$this->StrokeTexts();
$this->img->SetAngle($aa);
// Draw an outline around the image map
if (_JPG_DEBUG) {
$this->DisplayClientSideaImageMapAreas();
}
// Adjust the appearance of the image
$this->AdjustSaturationBrightnessContrast();
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
//JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.');
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
// If the filename is given as the special "__handle"
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}
示例5: Stroke
//.........这里部分代码省略.........
$oldimage = $this->img->CloneCanvasH();
}
if (!$this->y2orderback) {
// Stroke all plots for Y1 axis
for ($i = 0; $i < count($this->plots); ++$i) {
$this->plots[$i]->Stroke($this->img, $this->xscale, $this->yscale);
$this->plots[$i]->StrokeMargin($this->img);
}
}
// Stroke all plots for Y2 axis
if ($this->y2scale != null) {
for ($i = 0; $i < count($this->y2plots); ++$i) {
$this->y2plots[$i]->Stroke($this->img, $this->xscale, $this->y2scale);
}
}
if ($this->y2orderback) {
// Stroke all plots for Y1 axis
for ($i = 0; $i < count($this->plots); ++$i) {
$this->plots[$i]->Stroke($this->img, $this->xscale, $this->yscale);
$this->plots[$i]->StrokeMargin($this->img);
}
}
$n = count($this->ynaxis);
for ($i = 0; $i < $n; ++$i) {
$m = count($this->ynplots[$i]);
for ($j = 0; $j < $m; ++$j) {
$this->ynplots[$i][$j]->Stroke($this->img, $this->xscale, $this->ynscale[$i]);
$this->ynplots[$i][$j]->StrokeMargin($this->img);
}
}
if ($this->iIconDepth == DEPTH_FRONT) {
$this->StrokeIcons();
}
if ($this->iDoClipping) {
// Clipping only supports graphs at 0 and 90 degrees
if ($this->img->a == 0) {
$this->img->CopyCanvasH($oldimage, $this->img->img, $this->img->left_margin, $this->img->top_margin, $this->img->left_margin, $this->img->top_margin, $this->img->plotwidth + 1, $this->img->plotheight);
} elseif ($this->img->a == 90) {
$adj = ($this->img->height - $this->img->width) / 2;
$this->img->CopyCanvasH($oldimage, $this->img->img, $this->img->bottom_margin - $adj, $this->img->left_margin + $adj, $this->img->bottom_margin - $adj, $this->img->left_margin + $adj, $this->img->plotheight + 1, $this->img->plotwidth);
} else {
JpGraphError::RaiseL(25035, $this->img->a);
//('You have enabled clipping. Cliping is only supported for graphs at 0 or 90 degrees rotation. Please adjust you current angle (='.$this->img->a.' degrees) or disable clipping.');
}
$this->img->Destroy();
$this->img->SetCanvasH($oldimage);
}
$this->xscale->off = $oldoff;
if ($this->grid_depth == DEPTH_FRONT && !$_csim) {
$this->ygrid->Stroke();
$this->xgrid->Stroke();
}
// Stroke colored bands
$this->StrokeBands(DEPTH_FRONT, $_csim);
// Finally draw the axis again since some plots may have nagged
// the axis in the edges.
if (!$_csim) {
$this->StrokeAxis();
}
if ($this->y2scale != null && !$_csim) {
$this->y2axis->Stroke($this->xscale, false);
}
if (!$_csim) {
$this->StrokePlotBox();
}
// The titles and legends never gets rotated so make sure
// that the angle is 0 before stroking them
$aa = $this->img->SetAngle(0);
$this->StrokeTitles();
$this->footer->Stroke($this->img);
$this->legend->Stroke($this->img);
$this->img->SetAngle($aa);
$this->StrokeTexts();
$this->StrokeTables();
if (!$_csim) {
$this->img->SetAngle($aa);
// Draw an outline around the image map
if (_JPG_DEBUG) {
$this->DisplayClientSideaImageMapAreas();
}
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans', false)) {
require_once 'jpgraph_imgtrans.php';
//JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.');
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
// If the filename is given as the special "__handle"
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}
示例6: Stroke
function Stroke($aStrokeFileName = "")
{
$n = count($this->plots);
// Set Y-scale
if (!$this->yscale->IsSpecified() && count($this->plots) > 0) {
list($min, $max) = $this->GetPlotsYMinMax();
$this->yscale->AutoScale($this->img, 0, $max, $this->len / $this->ytick_factor);
}
// Set start position end length of scale (in absolute pixels)
$this->yscale->SetConstants($this->posx, $this->len);
// We need as many axis as there are data points
$nbrpnts = $this->plots[0]->GetCount();
// If we have no titles just number the axis 1,2,3,...
if ($this->axis_title == null) {
for ($i = 0; $i < $nbrpnts; ++$i) {
$this->axis_title[$i] = $i + 1;
}
} elseif (count($this->axis_title) < $nbrpnts) {
JpGraphError::RaiseL(18007);
}
//("Number of titles does not match number of points in plot.");
for ($i = 0; $i < $n; ++$i) {
if ($nbrpnts != $this->plots[$i]->GetCount()) {
JpGraphError::RaiseL(18008);
}
}
//("Each radar plot must have the same number of data points.");
if ($this->background_image != "") {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
}
$astep = 2 * M_PI / $nbrpnts;
// Prepare legends
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Legend($this);
}
$this->legend->Stroke($this->img);
$this->footer->Stroke($this->img);
if ($this->grid_depth == DEPTH_BACK) {
// Draw axis and grid
for ($i = 0, $a = M_PI / 2; $i < $nbrpnts; ++$i, $a += $astep) {
$this->axis->Stroke($this->posy, $a, $grid[$i], $this->axis_title[$i], $i == 0);
}
}
// Plot points
$a = M_PI / 2;
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img, $this->posy, $this->yscale, $a);
}
if ($this->grid_depth != DEPTH_BACK) {
// Draw axis and grid
for ($i = 0, $a = M_PI / 2; $i < $nbrpnts; ++$i, $a += $astep) {
$this->axis->Stroke($this->posy, $a, $grid[$i], $this->axis_title[$i], $i == 0);
}
}
$this->grid->Stroke($this->img, $grid);
$this->StrokeTitles();
// Stroke texts
if ($this->texts != null) {
foreach ($this->texts as $t) {
$t->Stroke($this->img);
}
}
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
// If the filename is given as the special "__handle"
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
示例7: Stroke
function Stroke($aStrokeFileName = "")
{
// If the filename is the predefined value = '_csim_special_'
// we assume that the call to stroke only needs to do enough
// to correctly generate the CSIM maps.
// We use this variable to skip things we don't strictly need
// to do to generate the image map to improve performance
// a best we can. Therefor you will see a lot of tests !$_csim in the
// code below.
$_csim = $aStrokeFileName === _CSIM_SPECIALFILE;
// Should we autoscale dates?
if (!$this->scale->IsRangeSet()) {
list($min, $max) = $this->GetBarMinMax();
$this->scale->SetRange($min, $max);
}
$this->scale->AdjustStartEndDay();
// Check if we should autoscale the image
$this->AutoSize();
// Should we start from the top or just spread the bars out even over the
// available height
$this->scale->SetVertLayout($this->iLayout);
if ($this->iLayout == GANTT_FROMTOP) {
$maxheight = max($this->GetMaxLabelHeight(), $this->GetMaxBarAbsHeight());
$this->scale->SetVertSpacing($maxheight * (1 + $this->iLabelVMarginFactor));
}
// If it hasn't been set find out the maximum line number
if ($this->scale->iVertLines == -1) {
$this->scale->iVertLines = $this->GetBarMaxLineNumber() + 1;
}
$maxwidth = max($this->scale->actinfo->GetWidth($this->img), max($this->GetMaxLabelWidth(), $this->scale->tableTitle->GetWidth($this->img)));
$this->scale->SetLabelWidth($maxwidth + $this->scale->divider->iWeight);
//*(1+$this->iLabelHMarginFactor));
if (!$_csim) {
$this->StrokePlotArea();
if ($this->iIconDepth == DEPTH_BACK) {
$this->StrokeIcons();
}
}
$this->scale->Stroke();
if (!$_csim) {
// Due to a minor off by 1 bug we need to temporarily adjust the margin
$this->img->right_margin--;
$this->StrokePlotBox();
$this->img->right_margin++;
}
// Stroke Grid line
$this->hgrid->Stroke($this->img, $this->scale);
$n = count($this->iObj);
for ($i = 0; $i < $n; ++$i) {
//$this->iObj[$i]->SetLabelLeftMargin(round($maxwidth*$this->iLabelHMarginFactor/2));
$this->iObj[$i]->Stroke($this->img, $this->scale);
}
$this->StrokeTitles();
if (!$_csim) {
$this->StrokeConstrains();
$this->footer->Stroke($this->img);
if ($this->iIconDepth == DEPTH_FRONT) {
$this->StrokeIcons();
}
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans', false)) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
// If the filename is given as the special "__handle"
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}
示例8: Stroke
function Stroke($aStrokeFileName = "")
{
// If the filename is the predefined value = '_csim_special_'
// we assume that the call to stroke only needs to do enough
// to correctly generate the CSIM maps.
// We use this variable to skip things we don't strictly need
// to do to generate the image map to improve performance
// a best we can. Therefor you will see a lot of tests !$_csim in the
// code below.
$_csim = $aStrokeFileName === _CSIM_SPECIALFILE;
// We need to know if we have stroked the plot in the
// GetCSIMareas. Otherwise the CSIM hasn't been generated
// and in the case of GetCSIM called before stroke to generate
// CSIM without storing an image to disk GetCSIM must call Stroke.
$this->iHasStroked = true;
$n = count($this->plots);
if ($this->pieaa) {
if (!$_csim) {
if ($this->background_image != "") {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
}
}
$w = $this->img->width;
$h = $this->img->height;
$oldimg = $this->img->img;
$this->img->CreateImgCanvas(2 * $w, 2 * $h);
$this->img->SetColor($this->margin_color);
$this->img->FilledRectangle(0, 0, 2 * $w - 1, 2 * $h - 1);
// Make all icons *2 i size since we will be scaling down the
// imahe to do the anti aliasing
$ni = count($this->iIcons);
for ($i = 0; $i < $ni; ++$i) {
$this->iIcons[$i]->iScale *= 2;
}
$this->StrokeIcons();
for ($i = 0; $i < $n; ++$i) {
if ($this->plots[$i]->posx > 1) {
$this->plots[$i]->posx *= 2;
}
if ($this->plots[$i]->posy > 1) {
$this->plots[$i]->posy *= 2;
}
$this->plots[$i]->Stroke($this->img, 1);
if ($this->plots[$i]->posx > 1) {
$this->plots[$i]->posx /= 2;
}
if ($this->plots[$i]->posy > 1) {
$this->plots[$i]->posy /= 2;
}
}
$indent = $this->doframe ? $this->frame_weight + ($this->doshadow ? $this->shadow_width : 0) : 0;
$indent += $this->framebevel ? $this->framebeveldepth + 1 : 0;
$this->img->CopyCanvasH($oldimg, $this->img->img, $indent, $indent, $indent, $indent, $w - 2 * $indent, $h - 2 * $indent, 2 * ($w - $indent), 2 * ($h - $indent));
$this->img->img = $oldimg;
$this->img->width = $w;
$this->img->height = $h;
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img, 2);
// Stroke labels
$this->plots[$i]->Legend($this);
}
} else {
if (!$_csim) {
if ($this->background_image != "") {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
}
}
$this->StrokeIcons();
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img);
$this->plots[$i]->Legend($this);
}
}
$this->legend->Stroke($this->img);
$this->footer->Stroke($this->img);
$this->StrokeTitles();
if (!$_csim) {
// Stroke texts
if ($this->texts != null) {
$n = count($this->texts);
for ($i = 0; $i < $n; ++$i) {
$this->texts[$i]->Stroke($this->img);
}
}
if (_JPG_DEBUG) {
$this->DisplayCSIMAreas();
}
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
//JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.');
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
//.........这里部分代码省略.........
示例9: Stroke
//.........这里部分代码省略.........
} elseif ($this->yscale->IsSpecified() && ($this->yscale->auto_ticks || !$this->yscale->ticks->IsSpecified())) {
// The tick calculation will use the user suplied min/max values to determine
// the ticks. If auto_ticks is false the exact user specifed min and max
// values will be used for the scale.
// If auto_ticks is true then the scale might be slightly adjusted
// so that the min and max values falls on an even major step.
$min = $this->yscale->scale[0];
$max = $this->yscale->scale[1];
$this->yscale->AutoScale($this->img, $min, $max, $this->len / $this->ytick_factor, $this->yscale->auto_ticks);
}
// Set start position end length of scale (in absolute pixels)
$this->yscale->SetConstants($this->posx, $this->len);
// We need as many axis as there are data points
$nbrpnts = $this->plots[0]->GetCount();
// If we have no titles just number the axis 1,2,3,...
if ($this->axis_title == null) {
for ($i = 0; $i < $nbrpnts; ++$i) {
$this->axis_title[$i] = $i + 1;
}
} elseif (count($this->axis_title) < $nbrpnts) {
JpGraphError::RaiseL(18007);
// ("Number of titles does not match number of points in plot.");
}
for ($i = 0; $i < $n; ++$i) {
if ($nbrpnts != $this->plots[$i]->GetCount()) {
JpGraphError::RaiseL(18008);
//("Each radar plot must have the same number of data points.");
}
}
if (!$_csim) {
if ($this->background_image != '') {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
$this->StrokeBackgroundGrad();
}
}
$astep = 2 * M_PI / $nbrpnts;
if (!$_csim) {
if ($this->iIconDepth == DEPTH_BACK) {
$this->StrokeIcons();
}
// Prepare legends
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Legend($this);
}
$this->legend->Stroke($this->img);
$this->footer->Stroke($this->img);
}
if (!$_csim) {
if ($this->grid_depth == DEPTH_BACK) {
// Draw axis and grid
for ($i = 0, $a = M_PI / 2; $i < $nbrpnts; ++$i, $a += $astep) {
$this->axis->Stroke($this->posy, $a, $grid[$i], $this->axis_title[$i], $i == 0);
}
$this->grid->Stroke($this->img, $grid);
}
if ($this->iIconDepth == DEPTH_BACK) {
$this->StrokeIcons();
}
}
// Plot points
$a = M_PI / 2;
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img, $this->posy, $this->yscale, $a);
}
if (!$_csim) {
if ($this->grid_depth != DEPTH_BACK) {
// Draw axis and grid
for ($i = 0, $a = M_PI / 2; $i < $nbrpnts; ++$i, $a += $astep) {
$this->axis->Stroke($this->posy, $a, $grid[$i], $this->axis_title[$i], $i == 0);
}
$this->grid->Stroke($this->img, $grid);
}
$this->StrokeTitles();
$this->StrokeTexts();
if ($this->iIconDepth == DEPTH_FRONT) {
$this->StrokeIcons();
}
}
// Should we do any final image transformation
if ($this->iImgTrans && !$_csim) {
if (!class_exists('ImgTrans', false)) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
if (!$_csim) {
// If the filename is given as the special "__handle"
// then the image handler is returned and the image is NOT
// streamed back
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}
示例10: Stroke
function Stroke($aStrokeFileName = "")
{
$_csim = $aStrokeFileName === _CSIM_SPECIALFILE;
$this->iHasStroked = true;
$n = count($this->plots);
if ($this->pieaa) {
if (!$_csim) {
if ($this->background_image != "") {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
}
}
$w = $this->img->width;
$h = $this->img->height;
$oldimg = $this->img->img;
$this->img->CreateImgCanvas(2 * $w, 2 * $h);
$this->img->SetColor($this->margin_color);
$this->img->FilledRectangle(0, 0, 2 * $w - 1, 2 * $h - 1);
$ni = count($this->iIcons);
for ($i = 0; $i < $ni; ++$i) {
$this->iIcons[$i]->iScale *= 2;
if ($this->iIcons[$i]->iX > 1) {
$this->iIcons[$i]->iX *= 2;
}
if ($this->iIcons[$i]->iY > 1) {
$this->iIcons[$i]->iY *= 2;
}
}
$this->StrokeIcons();
for ($i = 0; $i < $n; ++$i) {
if ($this->plots[$i]->posx > 1) {
$this->plots[$i]->posx *= 2;
}
if ($this->plots[$i]->posy > 1) {
$this->plots[$i]->posy *= 2;
}
$this->plots[$i]->Stroke($this->img, 1);
if ($this->plots[$i]->posx > 1) {
$this->plots[$i]->posx /= 2;
}
if ($this->plots[$i]->posy > 1) {
$this->plots[$i]->posy /= 2;
}
}
$indent = $this->doframe ? $this->frame_weight + ($this->doshadow ? $this->shadow_width : 0) : 0;
$indent += $this->framebevel ? $this->framebeveldepth + 1 : 0;
$this->img->CopyCanvasH($oldimg, $this->img->img, $indent, $indent, $indent, $indent, $w - 2 * $indent, $h - 2 * $indent, 2 * ($w - $indent), 2 * ($h - $indent));
$this->img->img = $oldimg;
$this->img->width = $w;
$this->img->height = $h;
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img, 2);
$this->plots[$i]->Legend($this);
}
} else {
if (!$_csim) {
if ($this->background_image != "") {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
$this->StrokeBackgroundGrad();
}
}
$this->StrokeIcons();
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img);
$this->plots[$i]->Legend($this);
}
}
$this->legend->Stroke($this->img);
$this->footer->Stroke($this->img);
$this->StrokeTitles();
if (!$_csim) {
if ($this->texts != null) {
$n = count($this->texts);
for ($i = 0; $i < $n; ++$i) {
$this->texts[$i]->Stroke($this->img);
}
}
if (_JPG_DEBUG) {
$this->DisplayCSIMAreas();
}
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}
示例11: Stroke
function Stroke($aStrokeFileName = "")
{
$_csim = $aStrokeFileName === _CSIM_SPECIALFILE;
if (!$this->scale->IsRangeSet()) {
list($min, $max) = $this->GetBarMinMax();
$this->scale->SetRange($min, $max);
}
$this->scale->AdjustStartEndDay();
$this->AutoSize();
$this->scale->SetVertLayout($this->iLayout);
if ($this->iLayout == GANTT_FROMTOP) {
$maxheight = max($this->GetMaxLabelHeight(), $this->GetMaxBarAbsHeight());
$this->scale->SetVertSpacing($maxheight * (1 + $this->iLabelVMarginFactor));
}
if ($this->scale->iVertLines == -1) {
$this->scale->iVertLines = $this->GetBarMaxLineNumber() + 1;
}
$maxwidth = max($this->scale->actinfo->GetWidth($this->img), max($this->GetMaxLabelWidth(), $this->scale->tableTitle->GetWidth($this->img)));
$this->scale->SetLabelWidth($maxwidth + $this->scale->divider->iWeight);
if (!$_csim) {
$this->StrokePlotArea();
if ($this->iIconDepth == DEPTH_BACK) {
$this->StrokeIcons();
}
}
$this->scale->Stroke();
if (!$_csim) {
$this->img->right_margin--;
$this->StrokePlotBox();
$this->img->right_margin++;
}
$this->hgrid->Stroke($this->img, $this->scale);
$n = count($this->iObj);
for ($i = 0; $i < $n; ++$i) {
$this->iObj[$i]->Stroke($this->img, $this->scale);
}
$this->StrokeTitles();
if (!$_csim) {
$this->StrokeConstrains();
$this->footer->Stroke($this->img);
if ($this->iIconDepth == DEPTH_FRONT) {
$this->StrokeIcons();
}
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}
示例12: Stroke
function Stroke($aStrokeFileName = "")
{
$n = count($this->plots);
if (!$this->yscale->IsSpecified() && count($this->plots) > 0) {
list($min, $max) = $this->GetPlotsYMinMax();
$this->yscale->AutoScale($this->img, 0, $max, $this->len / $this->ytick_factor);
} elseif ($this->yscale->IsSpecified() && ($this->yscale->auto_ticks || !$this->yscale->ticks->IsSpecified())) {
$min = $this->yscale->scale[0];
$max = $this->yscale->scale[1];
$this->yscale->AutoScale($this->img, $min, $max, $this->len / $this->ytick_factor, $this->yscale->auto_ticks);
}
$this->yscale->SetConstants($this->posx, $this->len);
$nbrpnts = $this->plots[0]->GetCount();
if ($this->axis_title == null) {
for ($i = 0; $i < $nbrpnts; ++$i) {
$this->axis_title[$i] = $i + 1;
}
} elseif (count($this->axis_title) < $nbrpnts) {
JpGraphError::RaiseL(18007);
}
for ($i = 0; $i < $n; ++$i) {
if ($nbrpnts != $this->plots[$i]->GetCount()) {
JpGraphError::RaiseL(18008);
}
}
if ($this->background_image != "") {
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
}
$astep = 2 * M_PI / $nbrpnts;
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Legend($this);
}
$this->legend->Stroke($this->img);
$this->footer->Stroke($this->img);
if ($this->grid_depth == DEPTH_BACK) {
for ($i = 0, $a = M_PI / 2; $i < $nbrpnts; ++$i, $a += $astep) {
$this->axis->Stroke($this->posy, $a, $grid[$i], $this->axis_title[$i], $i == 0);
}
}
$a = M_PI / 2;
for ($i = 0; $i < $n; ++$i) {
$this->plots[$i]->Stroke($this->img, $this->posy, $this->yscale, $a);
}
if ($this->grid_depth != DEPTH_BACK) {
for ($i = 0, $a = M_PI / 2; $i < $nbrpnts; ++$i, $a += $astep) {
$this->axis->Stroke($this->posy, $a, $grid[$i], $this->axis_title[$i], $i == 0);
}
}
$this->grid->Stroke($this->img, $grid);
$this->StrokeTitles();
if ($this->texts != null) {
foreach ($this->texts as $t) {
$t->Stroke($this->img);
}
}
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
示例13: Stroke
//.........这里部分代码省略.........
if ($this->y2scale != null) {
for ($i = 0; $i < count($this->y2plots); ++$i) {
$this->y2plots[$i]->Stroke($this->img, $this->xscale, $this->y2scale);
}
}
if ($this->y2orderback) {
for ($i = 0; $i < count($this->plots); ++$i) {
$this->plots[$i]->Stroke($this->img, $this->xscale, $this->yscale);
$this->plots[$i]->StrokeMargin($this->img);
}
}
$n = count($this->ynaxis);
for ($i = 0; $i < $n; ++$i) {
$m = count($this->ynplots[$i]);
for ($j = 0; $j < $m; ++$j) {
$this->ynplots[$i][$j]->Stroke($this->img, $this->xscale, $this->ynscale[$i]);
$this->ynplots[$i][$j]->StrokeMargin($this->img);
}
}
if ($this->iIconDepth == DEPTH_FRONT) {
$this->StrokeIcons();
}
if ($this->iDoClipping) {
if ($this->img->a == 0) {
$this->img->CopyCanvasH($oldimage, $this->img->img, $this->img->left_margin, $this->img->top_margin, $this->img->left_margin, $this->img->top_margin, $this->img->plotwidth + 1, $this->img->plotheight);
} elseif ($this->img->a == 90) {
$adj = ($this->img->height - $this->img->width) / 2;
$this->img->CopyCanvasH($oldimage, $this->img->img, $this->img->bottom_margin - $adj, $this->img->left_margin + $adj, $this->img->bottom_margin - $adj, $this->img->left_margin + $adj, $this->img->plotheight + 1, $this->img->plotwidth);
} else {
JpGraphError::RaiseL(25035, $this->img->a);
}
$this->img->Destroy();
$this->img->SetCanvasH($oldimage);
}
$this->xscale->off = $oldoff;
if ($this->grid_depth == DEPTH_FRONT && !$_csim) {
$this->ygrid->Stroke();
$this->xgrid->Stroke();
}
if ($this->bands != null) {
for ($i = 0; $i < count($this->bands); ++$i) {
if ($this->bands[$i]->depth == DEPTH_FRONT) {
$this->bands[$i]->Stroke($this->img, $this->xscale, $this->yscale);
}
}
}
if ($this->y2bands != null && $this->y2scale != null) {
for ($i = 0; $i < count($this->y2bands); ++$i) {
if ($this->y2bands[$i]->depth == DEPTH_FRONT) {
$this->y2bands[$i]->Stroke($this->img, $this->xscale, $this->y2scale);
}
}
}
if ($this->lines != null) {
for ($i = 0; $i < count($this->lines); ++$i) {
$this->lines[$i]->Stroke($this->img, $this->xscale, $this->yscale);
$this->lines[$i]->DoLegend($this);
}
}
if ($this->y2lines != null && $this->y2scale != null) {
for ($i = 0; $i < count($this->y2lines); ++$i) {
$this->y2lines[$i]->Stroke($this->img, $this->xscale, $this->y2scale);
$this->y2lines[$i]->DoLegend($this);
}
}
if (!$_csim) {
$this->StrokeAxis();
}
if ($this->y2scale != null && !$_csim) {
$this->y2axis->Stroke($this->xscale, false);
}
if (!$_csim) {
$this->StrokePlotBox();
}
$aa = $this->img->SetAngle(0);
$this->StrokeTitles();
$this->footer->Stroke($this->img);
$this->legend->Stroke($this->img);
$this->img->SetAngle($aa);
$this->StrokeTexts();
$this->StrokeTables();
if (!$_csim) {
$this->img->SetAngle($aa);
if (_JPG_DEBUG) {
$this->DisplayClientSideaImageMapAreas();
}
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
require_once 'jpgraph_imgtrans.php';
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D($this->iImgTransHorizon, $this->iImgTransSkewDist, $this->iImgTransDirection, $this->iImgTransHighQ, $this->iImgTransMinSize, $this->iImgTransFillColor, $this->iImgTransBorder);
}
if ($aStrokeFileName == _IMG_HANDLER) {
return $this->img->img;
} else {
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}