当前位置: 首页>>代码示例>>PHP>>正文


PHP Text::SetOrientation方法代码示例

本文整理汇总了PHP中Text::SetOrientation方法的典型用法代码示例。如果您正苦于以下问题:PHP Text::SetOrientation方法的具体用法?PHP Text::SetOrientation怎么用?PHP Text::SetOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Text的用法示例。


在下文中一共展示了Text::SetOrientation方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Stroke

 function Stroke($img, $aVal, $x, $y)
 {
     if ($this->show) {
         if ($this->negformat == "") {
             $this->negformat = $this->format;
         }
         if ($this->negcolor == "") {
             $this->negcolor = $this->color;
         }
         if ($aVal === NULL || is_string($aVal) && ($aVal == "" || $aVal == "-" || $aVal == "x")) {
             return;
         }
         if (is_numeric($aVal) && $aVal == 0 && $this->iHideZero) {
             return;
         }
         // Since the value is used in different cirumstances we need to check what
         // kind of formatting we shall use. For example, to display values in a line
         // graph we simply display the formatted value, but in the case where the user
         // has already specified a text string we don't fo anything.
         if ($this->iFormCallback != '') {
             $f = $this->iFormCallback;
             $sval = call_user_func($f, $aVal);
         } elseif (is_numeric($aVal)) {
             if ($aVal >= 0) {
                 $sval = sprintf($this->format, $aVal);
             } else {
                 $sval = sprintf($this->negformat, $aVal);
             }
         } else {
             $sval = $aVal;
         }
         $y = $y - sign($aVal) * $this->margin;
         $txt = new Text($sval, $x, $y);
         $txt->SetFont($this->ff, $this->fs, $this->fsize);
         if ($this->valign == "") {
             if ($aVal >= 0) {
                 $valign = "bottom";
             } else {
                 $valign = "top";
             }
         } else {
             $valign = $this->valign;
         }
         $txt->Align($this->halign, $valign);
         $txt->SetOrientation($this->angle);
         if ($aVal > 0) {
             $txt->SetColor($this->color);
         } else {
             $txt->SetColor($this->negcolor);
         }
         $txt->Stroke($img);
     }
 }
开发者ID:hostellerie,项目名称:nexpro,代码行数:53,代码来源:jpgraph.php

示例2: array

include "../jpgraph_line.php";
include "../jpgraph_error.php";
include "../jpgraph_bar.php";
$l1datay = array(11, 9, 2, 4, 3, 13, 17);
$l2datay = array(23, 12, 5, 19, 17, 10, 15);
$datax = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul");
// Create the graph.
$graph = new Graph(350, 200, "auto");
$graph->img->SetMargin(40, 70, 20, 40);
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->SetColor(array(250, 250, 250));
$graph->img->SetTransparent("white");
$t1 = new Text("This is a text");
$t1->SetPos(0.5, 0.5);
$t1->SetOrientation("h");
$t1->SetFont(FF_FONT1, FS_BOLD);
$t1->SetBox("white", "black", "gray");
$t1->SetColor("black");
$graph->AddText($t1);
// Create the linear error plot
$l1plot = new LinePlot($l1datay);
$l1plot->SetColor("blue");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$l2plot = new BarPlot($l2datay);
$l2plot->SetFillColor("orange");
$l2plot->SetLegend("Result");
// Add the plots to the graph
$graph->Add($l1plot);
开发者ID:jeromecc,项目名称:tuv2,代码行数:31,代码来源:example16.5.php

示例3: top

    function top($VAR)
    {
        global $smarty, $C_translate, $C_auth;
        # Get the period type, default to month
        if (empty($VAR['period'])) {
            $p = 'm';
        } else {
            $p = $VAR['period'];
        }
        # Load the jpgraph class
        include PATH_GRAPH . "jpgraph.php";
        include PATH_GRAPH . "jpgraph_bar.php";
        # check the validation for this function
        if (!$C_auth->auth_method_by_name($this->module, 'search')) {
            $error = $C_translate->translate('module_non_auth', '', '');
            include PATH_GRAPH . "jpgraph_canvas.php";
            $graph = new CanvasGraph(460, 55, "auto");
            $t1 = new Text($error);
            $t1->Pos(0.2, 0.5);
            $t1->SetOrientation("h");
            $t1->SetBox("white", "black", 'gray');
            $t1->SetFont(FF_FONT1, FS_NORMAL);
            $t1->SetColor("black");
            $graph->AddText($t1);
            $graph->Stroke();
            exit;
        }
        # Get the period start & end
        switch ($p) {
            # By Weeks:
            case 'w':
                $interval = "1";
                $width = ".9";
                $title = 'Top Accounts for Last Last Week';
                $dow = date('w');
                $start_str = mktime(0, 0, 0, date('m'), date('d') - $dow, date('y'));
                $end_str = mktime(23, 59, 59, date('m'), date('d'), date('y'));
                break;
                # By Months:
            # By Months:
            case 'm':
                $interval = "3";
                $width = ".6";
                $title = 'Top Accounts for Last Last Month';
                $start_str = mktime(0, 0, 0, date('m'), 1, date('y'));
                $end_str = mktime(23, 59, 59, date('m'), date('d'), date('y'));
                break;
                # By Years:
            # By Years:
            case 'y':
                $interval = "1";
                $width = ".8";
                $title = 'Top Accounts for Last Last Year';
                $start_str = mktime(0, 0, 0, 1, 1, date('y'));
                $end_str = mktime(23, 59, 59, date('m'), date('d'), date('y'));
                break;
        }
        ##############################@@@@@@@@
        # Get accounts & sales for this period
        ##############################@@@@@@@@
        $db =& DB();
        $sql = 'SELECT account_id,total_amt FROM ' . AGILE_DB_PREFIX . 'invoice WHERE
				   date_orig    >=  ' . $db->qstr($start_str) . ' AND  date_orig    <=  ' . $db->qstr($end_str) . ' AND
				   site_id      =  ' . $db->qstr(DEFAULT_SITE);
        $result = $db->Execute($sql);
        if (@$result->RecordCount() == 0) {
            $file = fopen(PATH_THEMES . 'default_admin/images/invisible.gif', 'r');
            fpassthru($file);
            exit;
        }
        while (!$result->EOF) {
            $amt = $result->fields['total_amt'];
            $acct = $result->fields['account_id'];
            if (!isset($arr[$acct])) {
                $arr[$acct] = 0;
            }
            $arr[$acct] += $amt;
            $result->MoveNext();
        }
        $i = 0;
        while (list($key, $var) = each(@$arr)) {
            # Get the user name
            $sql = 'SELECT first_name,last_name FROM ' . AGILE_DB_PREFIX . 'account WHERE
						   id           =  ' . $db->qstr($key) . ' AND
						   site_id      =  ' . $db->qstr(DEFAULT_SITE);
            $rs = $db->Execute($sql);
            $_lbl[] = strtoupper(substr($rs->fields['first_name'], 0, 1)) . ". " . $rs->fields['last_name'];
            $_datay[] = $var;
            $i++;
        }
        ### Sort the arrays
        array_multisort($_datay, SORT_DESC, SORT_NUMERIC, $_lbl);
        ### Limit the results to 10 or less
        for ($i = 0; $i < count($_lbl); $i++) {
            $lbl[$i] = $_lbl[$i];
            $datay[$i] = $_datay[$i];
            if ($i >= 9) {
                $i = count($_lbl);
            }
        }
//.........这里部分代码省略.........
开发者ID:chiranjeevjain,项目名称:agilebill,代码行数:101,代码来源:account_admin.inc.php

示例4: array

 function __construct($img, $aScale, $color = array(0, 0, 0))
 {
     $this->img = $img;
     $this->scale = $aScale;
     $this->color = $color;
     $this->title = new Text('');
     if ($aScale->type == 'y') {
         $this->title_margin = 25;
         $this->title_adjust = 'middle';
         $this->title->SetOrientation(90);
         $this->tick_label_margin = 7;
         $this->labelPos = SIDE_LEFT;
     } else {
         $this->title_margin = 5;
         $this->title_adjust = 'high';
         $this->title->SetOrientation(0);
         $this->tick_label_margin = 5;
         $this->labelPos = SIDE_DOWN;
         $this->title_side = SIDE_DOWN;
     }
 }
开发者ID:necrogami,项目名称:JpGraph,代码行数:21,代码来源:jpgraph.php

示例5: Stroke

 function Stroke(&$img, &$xscale, &$yscale)
 {
     $img->SetLineWeight($this->weight);
     for ($i = 0; $i < $this->numpoints - 1; $i++) {
         $accy = 0;
         $accy_neg = 0;
         for ($j = 0; $j < $this->nbrplots; ++$j) {
             $img->SetColor($this->plots[$j]->color);
             if ($this->plots[$j]->coords[0][$i] > 0) {
                 $yt = $yscale->Translate($this->plots[$j]->coords[0][$i] + $accy);
                 $accyt = $yscale->Translate($accy);
                 $accy += $this->plots[$j]->coords[0][$i];
             } else {
                 $yt = $yscale->Translate($this->plots[$j]->coords[0][$i] + $accy_neg);
                 $accyt = $yscale->Translate($accy_neg);
                 $accy_neg += $this->plots[$j]->coords[0][$i];
             }
             $xt = $xscale->Translate($i);
             $abswidth = round($this->width * $xscale->scale_factor, 0);
             $pts = array($xt, $accyt, $xt, $yt, $xt + $abswidth, $yt, $xt + $abswidth, $accyt);
             if ($this->plots[$j]->grad) {
                 $grad = new Gradient($img);
                 $grad->FilledRectangle($pts[2], $pts[3], $pts[6], $pts[7], $this->plots[$j]->grad_fromcolor, $this->plots[$j]->grad_tocolor, $this->plots[$j]->grad_style);
             } elseif ($this->plots[$j]->fill_color) {
                 $img->SetColor($this->plots[$j]->fill_color);
                 $img->FilledPolygon($pts, 4);
                 $img->SetColor($this->plots[$j]->color);
             }
             if ($this->bar_shadow) {
                 $ssh = $this->bar_shadow_hsize;
                 $ssv = $this->bar_shadow_vsize;
                 // Create points to create a "upper-right" shadow
                 $sp[0] = $pts[6];
                 $sp[1] = $pts[7];
                 $sp[2] = $pts[4];
                 $sp[3] = $pts[5];
                 $sp[4] = $pts[2];
                 $sp[5] = $pts[3];
                 $sp[6] = $pts[2] + $ssh;
                 $sp[7] = $pts[3] - $ssv;
                 $sp[8] = $pts[4] + $ssh;
                 $sp[9] = $pts[5] - $ssv;
                 $sp[10] = $pts[6] + $ssh;
                 $sp[11] = $pts[7] - $ssv;
                 $img->SetColor($this->bar_shadow_color);
                 $img->FilledPolygon($sp, 4);
             }
             if ($i < count($this->plots[$j]->csimtargets)) {
                 $this->csimareas .= "<area shape=\"rect\" coords=\"";
                 // Hmmm, this is fishy.  Fixes a bug in Opera whereby if Y2<Y1 or X2<X1 the csim doesn't work
                 // This means that the area MUST specify top left and bottom right corners
                 if ($pts[3] < $pts[7]) {
                     if ($pts[2] < $pts[6]) {
                         $this->csimareas .= "{$pts['2']}, {$pts['3']}, {$pts['6']}, {$pts['7']}\"";
                     } else {
                         $this->csimareas .= "{$pts['6']}, {$pts['3']}, {$pts['2']}, {$pts['7']}\"";
                     }
                 } else {
                     if ($pts[2] < $pts[6]) {
                         $this->csimareas .= "{$pts['2']}, {$pts['7']}, {$pts['6']}, {$pts['3']}\"";
                     } else {
                         $this->csimareas .= "{$pts['6']}, {$pts['7']}, {$pts['2']}, {$pts['3']}\"";
                     }
                 }
                 $this->csimareas .= " href=\"" . $this->plots[$j]->csimtargets[$i] . "\"";
                 if (!empty($this->plots[$j]->csimalts[$i])) {
                     $sval = sprintf($this->plots[$j]->csimalts[$i], $this->plots[$j]->coords[0][$i]);
                     $this->csimareas .= " alt=\"{$sval}\"";
                 }
                 $this->csimareas .= ">\r\n";
             }
             $img->Polygon($pts, 4);
         }
         $yt = $yscale->Translate($accy);
         if ($this->show_value) {
             $sval = sprintf($this->show_value_format, $accy);
             $txt = new Text($sval);
             $txt->SetFont($this->show_value_ff, $this->show_value_fs, $this->show_value_fsize);
             $txt->SetColor($this->show_value_color);
             $x = $pts[2] + ($pts[4] - $pts[2]) / 2;
             if ($this->bar_shadow) {
                 $x += $ssh;
             }
             $txt->Pos($x, $yt - $this->show_value_margin);
             $txt->Align("center", "bottom");
             $txt->SetOrientation($this->show_value_angle);
             $txt->Stroke($img);
         }
     }
     return true;
 }
开发者ID:ahviplc,项目名称:judgegirl,代码行数:91,代码来源:jpgraph_bar.php

示例6: CanvasGraph

 function BAR_graph($module, $type, $start, $extra_fields)
 {
     global $C_translate, $C_auth;
     include_once PATH_CORE . 'validate.inc.php';
     $dt = new CORE_validate();
     include PATH_GRAPH . "jpgraph.php";
     ####################################################################
     ### Check if 'search' is authorized for this account
     ####################################################################
     # check the validation for this function
     if ($C_auth->auth_method_by_name($module, 'search')) {
         # validate this file exists, and include it.
         if (file_exists(PATH_MODULES . '/' . $module . '/' . $module . '.inc.php')) {
             include_once PATH_MODULES . '/' . $module . '/' . $module . '.inc.php';
         } else {
             ### Not exist!
             $error = $C_translate->translate('module_non_existant', '', '');
         }
     } else {
         ### Not auth
         $error = $C_translate->translate('module_non_auth', '', '');
     }
     if (isset($error)) {
         include PATH_GRAPH . "jpgraph_canvas.php";
         // Create the graph.
         $graph = new CanvasGraph(460, 55, "auto");
         $t1 = new Text($error);
         $t1->Pos(0.2, 0.5);
         $t1->SetOrientation("h");
         $t1->SetBox("white", "black", 'gray');
         $t1->SetFont(FF_FONT1, FS_NORMAL);
         $t1->SetColor("black");
         $graph->AddText($t1);
         $graph->Stroke();
         exit;
     }
     ####################################################################
     ### BY WEEK
     ####################################################################
     if ($type == 'week') {
         $FONT_SIZE = 7;
         $AbsWidth = 12;
         $interval = 4;
         $type = $C_translate->translate('week', '', '');
         if ($start == "" || $start <= 12) {
             ## Get the beginning/end of this week
             $start_str = mktime(24, 0, 0, 12, 31, date("Y") - 1);
             $start = date(UNIX_DATE_FORMAT, $start_str);
             $end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
             $end = date(UNIX_DATE_FORMAT, $end_str);
         } else {
             ## Get the beginning/end of the specified week
             $start_str = mktime(24, 0, 0, 12, 31, date("{$start}") - 1);
             $start = date(UNIX_DATE_FORMAT, $start_str);
             $end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
             $end = date(UNIX_DATE_FORMAT, $end_str);
         }
         ### Set the constraint array:
         $curr_str = $start_str;
         while ($curr_str <= $end_str) {
             $new_curr_str = mktime(0, 0, 0, date("m", $curr_str), date("d", $curr_str) + 7, date("Y", $curr_str));
             $constraint_array[] = array('start' => $curr_str, 'end' => $new_curr_str);
             $curr_str = $new_curr_str;
             $default_array[] = 0;
         }
     } else {
         if ($type == 'month') {
             $FONT_SIZE = 10;
             $AbsWidth = 12;
             $TickLables = $gDateLocale->GetShortMonth();
             $interval = 1;
             $type = $C_translate->translate('month', '', '');
             if ($start == "" || $start < 12) {
                 ## Get the beginning/end of this week
                 $start_str = mktime(24, 0, 0, 12, 31, date("Y") - 1);
                 $start = date(UNIX_DATE_FORMAT, $start_str);
                 $end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
                 $end = date(UNIX_DATE_FORMAT, $end_str);
             } else {
                 ## Get the beginning/end of the specified week
                 ## Get the beginning/end of this week
                 $start_str = mktime(24, 0, 0, 12, 31, date("{$start}") - 1);
                 $start = date(UNIX_DATE_FORMAT, $start_str);
                 $end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
                 $end = date(UNIX_DATE_FORMAT, $end_str);
             }
             ### Set the constraint array:
             $curr_str = $start_str;
             while ($curr_str <= $end_str) {
                 $new_curr_str = mktime(0, 0, 0, date("m", $curr_str) + 1, date("d", $curr_str), date("Y", $curr_str));
                 $constraint_array[] = array('start' => $curr_str, 'end' => $new_curr_str);
                 $curr_str = $new_curr_str;
                 $default_array[] = 0;
             }
         } else {
             if ($type == 'year') {
                 $FONT_SIZE = 10;
                 $interval = 1;
                 $AbsWidth = 13;
                 $type = $C_translate->translate('year', '', '');
//.........这里部分代码省略.........
开发者ID:chiranjeevjain,项目名称:agilebill,代码行数:101,代码来源:graph.inc.php

示例7: Stroke

 function Stroke(&$img, &$xscale, &$yscale)
 {
     $numpoints = count($this->coords[0]);
     if (isset($this->coords[1])) {
         if (count($this->coords[1]) != $numpoints) {
             JpGraphError::Raise("JpGraph Error: Number of X and Y points are not equal.<br>\r\n\t\t\t\t\tNumber of X-points:" . count($this->coords[1]) . "<br>\r\n\t\t\t\t\tNumber of Y-points:{$numpoints}");
         } else {
             $exist_x = true;
         }
     } else {
         $exist_x = false;
     }
     if ($exist_x) {
         $xs = $this->coords[1][0];
     } else {
         $xs = 0;
     }
     $img->SetStartPoint($xscale->Translate($xs), $yscale->Translate($this->coords[0][0]));
     if ($this->filled) {
         $cord[] = $xscale->Translate($xs);
         $cord[] = $yscale->Translate($yscale->GetMinVal());
     }
     $cord[] = $xscale->Translate($xs);
     $cord[] = $yscale->Translate($this->coords[0][0]);
     $yt_old = $yscale->Translate($this->coords[0][0]);
     $img->SetColor($this->color);
     $img->SetLineWeight($this->weight);
     $img->SetLineStyle($this->line_style);
     for ($pnts = 1; $pnts < $numpoints; ++$pnts) {
         if ($exist_x) {
             $x = $this->coords[1][$pnts];
         } else {
             $x = $pnts;
         }
         $xt = $xscale->Translate($x);
         $yt = $yscale->Translate($this->coords[0][$pnts]);
         $cord[] = $xt;
         $cord[] = $yt;
         if ($this->step_style) {
             $img->StyleLineTo($xt, $yt_old);
             $img->StyleLineTo($xt, $yt);
         } else {
             $y = $this->coords[0][$pnts];
             if (is_numeric($y) || is_string($y) && $y != "-") {
                 $tmp1 = $this->coords[0][$pnts];
                 $tmp2 = $this->coords[0][$pnts - 1];
                 if (is_numeric($tmp1) && (is_numeric($tmp2) || $tmp2 == "-")) {
                     $img->StyleLineTo($xt, $yt);
                 } else {
                     $img->SetStartPoint($xt, $yt);
                 }
             }
         }
         $yt_old = $yt;
         if ($this->value->show) {
             $sval = sprintf($this->value->format, $this->coords[0][$pnts]);
             $txt = new Text($sval, $xt, $yt - $this->value->margin);
             $txt->SetFont($this->value->ff, $this->value->fs, $this->value->fsize);
             $txt->Align("center", "bottom");
             $txt->SetOrientation($this->value->angle);
             $txt->SetColor($this->value->color);
             $txt->Stroke($img);
         }
     }
     if ($this->filled) {
         $cord[] = $xt;
         $cord[] = $yscale->Translate($yscale->GetMinVal());
         $img->SetColor($this->fill_color);
         $img->FilledPolygon($cord);
         $img->SetColor($this->color);
         $img->Polygon($cord);
     }
     $adjust = 0;
     if ($this->filled) {
         $adjust = 2;
     }
     for ($i = $adjust; $i < count($cord) - $adjust; $i += 2) {
         if (is_numeric($this->coords[0][($i - $adjust) / 2])) {
             $this->mark->Stroke($img, $cord[$i], $cord[$i + 1]);
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:82,代码来源:jpgraph_line.php

示例8: Stroke

 function Stroke($img, $aVal, $x, $y)
 {
     if ($this->show) {
         if ($this->negformat == "") {
             $this->negformat = $this->format;
         }
         if ($this->negcolor == "") {
             $this->negcolor = $this->color;
         }
         if ($aVal == NULL || is_string($aVal) && ($aVal == "" || $aVal == "-" || $aVal == "x")) {
             return;
         }
         if ($aVal >= 0) {
             $sval = sprintf($this->format, $aVal);
         } else {
             $sval = sprintf($this->negformat, $aVal);
         }
         $txt = new Text($sval, $x, $y - sign($aVal) * $this->margin);
         $txt->SetFont($this->ff, $this->fs, $this->fsize);
         if ($this->valign == "") {
             if ($aVal >= 0) {
                 $valign = "bottom";
             } else {
                 $valign = "top";
             }
         } else {
             $valign = $this->valign;
         }
         $txt->Align($this->halign, $valign);
         $txt->SetOrientation($this->angle);
         if ($aVal > 0) {
             $txt->SetColor($this->color);
         } else {
             $txt->SetColor($this->negcolor);
         }
         $txt->Stroke($img);
     }
 }
开发者ID:rrsc,项目名称:freemed,代码行数:38,代码来源:jpgraph.php

示例9: buildGraphicByYear


//.........这里部分代码省略.........
         inicialmente ele eh inicializada com o gabarito, e serao preenchidos os valores
         dos meses no laço for logo abaixo
         */
         $valores = $data;
         for ($k = 0; $k <= count($valores); $k++) {
             if ($meses[$k]) {
                 $valores[$k] = $meses[$k];
             }
         }
         if (count($valores) > 12) {
             unset($valores[0]);
         }
         $valores = array_values($valores);
         /*
         aqui eu uso "Variáveis Variáveis" do PHP para poder
         inserir vária linhas no gráfico
         */
         $nome = "barplot" . $ano;
         ${$nome} = new BarPlot($valores);
         $cor = $cores[$colorIndex];
         ${$nome}->SetFillColor($cor);
         ${$nome}->SetColor($cor);
         /*configs para os valores do ponto*/
         ${$nome}->value->SetColor("darkred");
         ${$nome}->value->SetFont(FF_FONT1, FS_BOLD);
         ${$nome}->value->SetFormat("%0.1d");
         //				$$nome->SetWeight(20);
         // Arrumando para um tamanho mais amigavel
         if (count($anos) < 3) {
             ${$nome}->SetWidth(20);
         } else {
             if (count($anos) < 4) {
                 ${$nome}->SetWidth(15);
             } else {
                 if (count($anos) < 6) {
                     ${$nome}->SetWidth(10);
                 } else {
                     if (count($anos) < 8) {
                         ${$nome}->SetWidth(5);
                     } else {
                         if (count($anos) < 11) {
                             ${$nome}->SetWidth(3);
                         }
                     }
                 }
             }
         }
         ${$nome}->value->Show();
         ${$nome}->value->iHideZero = true;
         ${$nome}->setLegend($ano);
         /*adicionando a linha ao grafico*/
         $colorIndex++;
         // Somente monta o gráfico dos anos exigidos pelo usuário
         for ($i = 0; $i < count($anos); $i++) {
             if ($ano == $startYear + $i) {
                 $graficoStatus = true;
                 // entrou no for significa que o gráfico vai ser construido
                 array_push($bars, ${$nome});
             }
         }
     }
     /****************************************************************
      * Se não existir dados estatísticos para o período selecionado	*
      * Então ele constroi uma imagem com a mensagem de que não		*
      * existem dados estatísticos.									*
      *****************************************************************/
     if ($graficoStatus == false) {
         $graph = new CanvasGraph(600, 30);
         $t1 = new Text(GRAFIC_STATS_FALSE);
         $t1->Pos(0.05, 0.5);
         $t1->SetOrientation('h');
         $t1->SetFont(FF_FONT1, FS_BOLD);
         $t1->SetColor('black');
         $graph->AddText($t1);
         $graph->Stroke();
         return $graficoStatus;
     }
     $gbplot = new GroupBarPlot($bars);
     $gbplot->SetWidth(0.9);
     $graph->Add($gbplot);
     $graph->yaxis->scale->SetGrace(20);
     $graph->img->SetMargin(40, 20, 20, 40);
     $graph->title->Set(ARTICLE_ACCESS);
     $graph->xaxis->title->Set(MONTHS);
     $graph->yaxis->title->Set(ACCESSES);
     $graph->title->SetFont(FF_FONT1, FS_BOLD);
     $graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
     $graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
     $graph->SetShadow();
     $graph->xaxis->SetTickLabels(explode(",", MONTH_LIST));
     // Adjust the legend position
     //			$graph->legend->SetLayout(LEGEND_VER);
     $graph->legend->Pos(0.04, 0.092, "", "center");
     $graph->legend->SetLayout(LEGEND_HOR);
     // Mostra o gráfico somente se, o ano que o usuario entrou existir estatisticas
     if ($graficoStatus == true) {
         $graph->Stroke();
     }
     return $graficoStatus;
 }
开发者ID:robertatakenaka,项目名称:Proceedings,代码行数:101,代码来源:AccessServiceBar.php

示例10: Stroke

 function Stroke(&$img, $aVal, $x, $y)
 {
     if ($this->show) {
         if ($this->negformat == "") {
             $this->negformat = $this->format;
         }
         if ($this->negcolor == "") {
             $this->negcolor = $this->color;
         }
         if ($aVal === NULL || is_string($aVal) && ($aVal == "" || $aVal == "-" || $aVal == "x")) {
             return;
         }
         if (is_numeric($aVal) && $aVal == 0 && $this->iHideZero) {
             return;
         }
         if ($this->iFormCallback != '') {
             $f = $this->iFormCallback;
             $sval = call_user_func($f, $aVal);
         } elseif (is_numeric($aVal)) {
             if ($aVal >= 0) {
                 $sval = sprintf($this->format, $aVal);
             } else {
                 $sval = sprintf($this->negformat, $aVal);
             }
         } else {
             $sval = $aVal;
         }
         $y = $y - sign($aVal) * $this->margin;
         $txt = new Text($sval, $x, $y);
         $txt->SetFont($this->ff, $this->fs, $this->fsize);
         if ($this->valign == "") {
             if ($aVal >= 0) {
                 $valign = "bottom";
             } else {
                 $valign = "top";
             }
         } else {
             $valign = $this->valign;
         }
         $txt->Align($this->halign, $valign);
         $txt->SetOrientation($this->angle);
         if ($aVal > 0) {
             $txt->SetColor($this->color);
         } else {
             $txt->SetColor($this->negcolor);
         }
         $txt->Stroke($img);
     }
 }
开发者ID:natanoj,项目名称:nuBuilderPro,代码行数:49,代码来源:jpgraph.php


注:本文中的Text::SetOrientation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。