本文整理汇总了PHP中JpGraphError::raise方法的典型用法代码示例。如果您正苦于以下问题:PHP JpGraphError::raise方法的具体用法?PHP JpGraphError::raise怎么用?PHP JpGraphError::raise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JpGraphError
的用法示例。
在下文中一共展示了JpGraphError::raise方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetMargin
function SetMargin($lm, $rm, $tm, $bm)
{
$this->left_margin = $lm;
$this->right_margin = $rm;
$this->top_margin = $tm;
$this->bottom_margin = $bm;
$this->plotwidth = $this->width - $this->left_margin - $this->right_margin;
$this->plotheight = $this->height - $this->top_margin - $this->bottom_margin;
if ($this->width > 0 && $this->height > 0) {
if ($this->plotwidth < 0 || $this->plotheight < 0) {
JpGraphError::raise("To small plot area. ({$lm},{$rm},{$tm},{$bm} : {$this->plotwidth} x {$this->plotheight}). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.");
}
}
$this->NotifyObservers();
}
示例2: CResultatsLaboGraph
function CResultatsLaboGraph($patient, $examen, $resultats)
{
$resultats = array_reverse($resultats, true);
if ($examen->type != "num") {
JpGraphError::raise("Le type d'examen doit être numérique pour être affiché");
}
// Prepare values
// Value plot
$ydata = array();
$xlabels = array();
$min = $examen->min;
$max = $examen->max;
foreach ($resultats as $resultat) {
$min = min($min, $resultat->resultat);
$max = max($max, $resultat->resultat);
$ydata[] = $resultat->resultat;
$xlabels[] = $resultat->date ? CMbDT::transform(null, $resultat->date, "%d/%m/%y") : "attendu";
}
// Setup the graph.
$this->Graph(360, 250, "auto");
$delta = 2;
$this->SetScale("textlin", max(0, $min - $delta), $max + $delta);
$this->SetMarginColor("lightblue");
// Image setup
$this->img->SetAntiAliasing(true);
$this->img->SetMargin(40, 10, 30, 40);
if ($examen->max) {
$uband = new PlotBand(HORIZONTAL, BAND_RDIAG, $examen->max, "max", "#ffbbbb");
$uband->ShowFrame(true);
$uband->SetDensity(92);
$this->AddBand($uband);
}
if ($examen->min) {
$lband = new PlotBand(HORIZONTAL, BAND_RDIAG, "min", $examen->min, "#ffbbbb");
$lband->ShowFrame(true);
$lband->SetDensity(92);
$this->AddBand($lband);
}
// Legend setup
$this->legend->Pos(0.02, 0.5, "right", "center");
$this->legend->SetShadow("darkgray@0.5", 3);
$this->legend->SetFont(FF_ARIAL, FS_NORMAL, 7);
$this->legend->SetFillColor("white@0.3");
// Title setup
$this->title->SetFont(FF_ARIAL, FS_NORMAL, 10);
$this->title->SetColor("darkred");
$this->title->Set("Résultats pour " . $examen->_view);
$this->subtitle->SetFont(FF_ARIAL, FS_NORMAL, 8);
$this->subtitle->SetColor("darkgray");
$this->subtitle->Set($patient->_view);
// Setup X-axis labels
$this->xgrid->Show(true);
$this->xgrid->SetColor("lightgray", "lightgray:1.7");
$this->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 7);
$this->xaxis->SetLabelAlign("right", "top", "right");
$this->xaxis->SetLabelMargin(2);
$this->xaxis->SetLabelAngle(45);
$this->xaxis->SetTickLabels($xlabels);
// Setup Y-axis labels
$this->ygrid->Show(true, true);
$this->ygrid->SetColor("lightgray", "lightgray:1.7");
$this->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
$this->yaxis->scale->ticks->SupressMinorTickMarks(false);
$this->yaxis->title->SetFont(FF_ARIAL, FS_NORMAL, 7);
$this->yaxis->title->SetColor("darkred");
$this->yaxis->title->Set("valeurs en {$examen->unite}");
$this->yaxis->SetLabelMargin(4);
$this->yaxis->SetTitleMargin(28);
$plot = new LinePlot($ydata);
$plot->SetCenter();
$plot->mark->SetType(MARK_FILLEDCIRCLE);
$plot->mark->SetFillColor("gray");
$this->Add($plot);
}