• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getColor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getColor函数的典型用法代码示例。如果您正苦于以下问题:PHP getColor函数的具体用法?PHP getColor怎么用?PHP getColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: draw_clusters

function draw_clusters($tset, $clusters, $centroids = null, $lines = False, $w = 300, $h = 200)
{
    if (!function_exists('imagecreate')) {
        return null;
    }
    $im = imagecreatetruecolor($w, $h);
    $white = imagecolorallocate($im, 255, 255, 255);
    $colors = array();
    $NC = count($clusters);
    for ($i = 1; $i <= $NC; $i++) {
        list($r, $g, $b) = getColor($i / $NC);
        $colors[] = imagecolorallocate($im, $r, $g, $b);
    }
    imagefill($im, 0, 0, $white);
    foreach ($clusters as $cid => $cluster) {
        foreach ($cluster as $idx) {
            $data = $tset[$idx]->getDocumentData();
            imagesetpixel($im, $data['x'], $data['y'], $colors[$cid]);
        }
        if (is_array($centroids)) {
            $x = $centroids[$cid]['x'];
            $y = $centroids[$cid]['y'];
            if ($lines) {
                // draw line
                // for cosine similarity
                //imagesetthickness($im,5);
                //imageline($im,0,0,$x*400,$y*400,$colors[$cid]);
            } else {
                // draw circle for euclidean
                imagefilledarc($im, $x, $y, 10, 10, 0, 360, $colors[$cid], 0);
            }
        }
    }
    return $im;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:35,代码来源:cluster_testing.php


示例2: createGistagramm

 function createGistagramm($width, $heigth)
 {
     $image = @imagecreate($width, $heigth);
     $maxKey = findMaxKey($this->array);
     $maxValue = findMaxValue($this->array);
     ImageColorAllocate($image, 255, 255, 255);
     ImageLine($image, $this->align, $heigth - $this->align, $width - $this->align, $heigth - $this->align, 1);
     ImageLine($image, $this->align, $this->align, $this->align, $heigth - $this->align, 1);
     $widthRect = round(($width - 2 * $this->align) / ($maxKey + 1)) * $this->widthColumn;
     foreach ($this->array as $key => $value) {
         $color = getColor($image, $value, $maxValue);
         $heigthRect = round($value * ($heigth - 2 * $this->align) / $maxValue);
         $pos = round($key / ($maxKey + 1) * ($width - 2 * $this->align)) + $this->align;
         ImageFilledRectangle($image, $pos - $widthRect / 2, $heigth - $heigthRect, $pos + $widthRect / 2, $heigth - $this->align, $color);
         ImageString($image, 0, $pos - $widthRect / 2, $heigth - $heigthRect - 10, $value, 1);
         ImageString($image, 0, $pos - $widthRect / 2, $heigth - $this->align, $key, 1);
     }
     $this->image = $image;
 }
开发者ID:mpospelov,项目名称:fedoruk_php,代码行数:19,代码来源:GistagrammClass.php


示例3: getPlayers

function getPlayers()
{
    $mysqli = new MySQLi("localhost", "wotmanager", "DT5HtrpaUlJ3iVGm", "testing", 3306);
    $stmt = $mysqli->prepare("SELECT ID,nick,battles,tier,wn8,wr,rwn8,rwr,clan,time FROM result order by time desc");
    $stmt->bind_result($id, $nick, $battles, $tier, $wn8, $wr, $rwn8, $rwr, $clan, $updated);
    $stmt->execute();
    while ($stmt->fetch()) {
        echo '<tr>
      <td><b><a href="http://stats.wotmanager.com/na/player/' . $nick . '" target="_blank">' . $nick . '</a></b></td>
      <td><b><font color="' . getColor($battles, "bat") . '">' . $battles . '</font></b></td>
      <td><b><font color="' . getColor($tier, "tier") . '">' . $tier . '</font></b></td>
      <td><b><font color="' . getColor($wn8, "wn8") . '">' . $wn8 . '</font></b></td>
      <td><b><font color="' . getColor($wr, "wr") . '">' . $wr . '</font></b></td>
      <td><b><font color="' . getColor($rwn8, "wn8") . '">' . $rwn8 . '</font></b></td>
      <td><b><font color="' . getColor($rwr, "wr") . '">' . $rwr . '</font></b></td>
      <td>' . $clan . '</td>
      <td>' . $updated . '</td>
      <td><a href="http://forum.worldoftanks.com/index.php?app=members&module=messaging&section=send&do=form&preview=1&_from=quickPM&fromMemberID=' . $id . '"target="_blank"><i class="fa fa-envelope fa-lg"></i></a></td>
    </tr>';
    }
}
开发者ID:josh-channin,项目名称:wotmanager,代码行数:21,代码来源:index.php


示例4: htmlGetSpots

function htmlGetSpots($data)
{
    $retour = "";
    $spots = getSpots($data);
    $j = 1;
    // Parcours les spots
    foreach ($spots as $spot) {
        $td_monstres = "";
        $i = 0;
        $level = 0;
        // Parcours le spot
        foreach ($spot as $monstre) {
            if (count($monstre) != 1) {
                $a = explode(" [", $monstre["name"]);
                $name = trim($a[0]);
                $age = trim(str_replace("]", "", $a[1]));
                $td_monstres .= '<tr><td>' . $monstre["level"] . '</td>';
                if ($monstre["level"] != "?") {
                    $level += $monstre["level"];
                } else {
                    --$i;
                }
                $td_monstres .= '<td><a href="" onClick="window.open(\'http://games.mountyhall.com/mountyhall/View/MonsterView.php?ai_IDPJ=' . $monstre["id"] . '\',\'_blank\',\'toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=766, height=636\');return(false);">' . $monstre["id"] . '</a></td>';
                $td_monstres .= '<td><a href="/bestiaire2/bestiaire.php?Monstre=' . $name . '&Age=' . $age . '&MH=' . $monstre["id"] . '" target="_blank">' . $monstre["name"] . '</a></td>';
                $td_monstres .= '<td><a href="/cockpit.php?cX=' . $monstre["X"] . '&cY=' . $monstre["Y"] . '&cZ=' . $monstre["N"] . '" target="_blank">' . $monstre["X"] . " " . $monstre["Y"] . " " . $monstre["N"] . "</a></td></tr>";
                ++$i;
            }
        }
        // Affiche le spot si il correspond aux critères de recherche
        if (intval($data["number"]) <= $i && intval($data["level"]) <= intval($level / $i)) {
            $retour .= '<table class="mh_tdtitre" border="1" align="center" cellpadding="5"><tr bgcolor="' . getColor($i) . '"><th>Niv. Moyen : ' . intval($level / $i) . '</th><th colspan="3">Spot numéro : ' . $j . '</th></tr>' . $td_monstres . '</table><br/>';
        }
        ++$j;
    }
    return $retour;
}
开发者ID:relaismago,项目名称:outils,代码行数:36,代码来源:functions_gmab.php


示例5: getTitle

echo getTitle(3);
?>
</div>
								<p>
									<span class="CuerpoArticulo"><?php 
echo getCopete(3, 160);
?>
</span>
								</p>
							</div>
							<div align="left" id="divNoticia4" style="cursor:hand; height:120px;" title="Click aquí para modificar la Noticia 4" onClick="editarNoticia(4)" onMouseOut="mouseOutNotica(4)" onMouseOver="mouseOverNotica(4)">
								<div align="left" class="TituloNoticiasSecundarias" style="background-image: url('/modules/arteria_noticias/fondo_titulos/fondo_chico_<?php 
echo getColor(4);
?>
.jpg'); background-repeat:no-repeat; color:#<?php 
echo getColor(4);
?>
; height:53px; line-height:56px;"><?php 
echo getTitle(4);
?>
</div>
								<p>
									<span class="CuerpoArticulo"><?php 
echo getCopete(4, 160);
?>
</span>
								</p>
							</div>
						</td>
					</tr>
				</table>
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:31,代码来源:boletin.php


示例6: imagecreatetruecolor

$im = imagecreatetruecolor($title_row["w"], $title_row["h"]);
imageantialias($im, true);
imagealphablending($im, false);
$alpha = imagecolorallocatealpha($im, 255, 255, 255, 127);
imagefilledrectangle($im, 0, 0, $title_row["w"], $title_row["h"], $alpha);
imagealphablending($im, true);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
if ($title_row["type"] == "text") {
    $commands = getLinesFromText($title_row["path"]);
} else {
    $commands = array();
}
foreach ($commands as $c) {
    if ($c["command"] == "poly") {
        $color = getColor($id, $c["color"], $im);
        imagefilledpolygon($im, $c["points"], count($c["points"]) / 2, $color);
    } elseif ($c["command"] == "asset") {
        $asset = imagecreatefrompng($c["asset"]);
        imagecopy($im, $asset, $c["points"][0], $c["points"][1], 0, 0, $c["points"][2], $c["points"][3]);
    } elseif ($c["command"] == "img") {
        $imgsrc = getContent($id, $c["asset"]);
        $img = imagecreatefrompng("{$imgsrc}");
        $size = getimagesize("{$imgsrc}");
        imagecopyresampled($im, $img, $c["points"][0], $c["points"][1], 0, 0, $c["points"][2], $c["points"][3], $size[0], $size[1]);
    } elseif ($c["command"] == "text") {
        $content = getContent($id, $c["content"]);
        $font = getFont($c["font"]);
        if ($c["align"] == "r") {
            $r = imagefttext($im, $c["size"], 0, 700, 0, $white, $font, $content);
            $c["points"][0] -= $r[2] - $r[0];
开发者ID:hamilr2,项目名称:rpits,代码行数:31,代码来源:render_title.php


示例7: writeText

function writeText($image, $size, $xpos, $ypos, $color, $font, $text, $shadow)
{
    $color = getColor($color, $image);
    // Create a drop shadow
    if ($shadow != '') {
        $shadow = getColor($shadow, $image);
        imagettftext($image, $size, 0, $xpos + 1, $ypos + 1, $shadow, $font, $text);
    }
    // Write the text
    imagettftext($image, $size, 0, $xpos, $ypos, $color, $font, $text);
}
开发者ID:reddragon010,项目名称:wowroster-rge,代码行数:11,代码来源:realmstatus.php


示例8: str_replace

				    <tr>
				        <td><img src="images/<?php 
            if (isset($_SESSION['color'][$flowername])) {
                echo $_SESSION['color'][$flowername];
            } else {
                echo $_SESSION['image'][$flowername];
            }
            ?>
.jpg" alt="" width="80" height="80"/></td>
				        <td><?php 
            echo str_replace('_', ' ', $flowername);
            ?>
</td>
				        <td><?php 
            if (isset($_SESSION['color'][$flowername])) {
                echo getColor($_SESSION['color'][$flowername]);
            } else {
                echo '&nbsp;';
            }
            ?>
</td>
				        <td><?php 
            echo $amount;
            ?>
</td>
				        <td>$<?php 
            echo $cost = $amount * $price[$flowername];
            $total += $cost;
            ?>
</td>
			        </tr>
开发者ID:pedmands,项目名称:php-module01,代码行数:31,代码来源:order.php


示例9: LinePlot

             $graph->title->SetFont(FF_SIMSUN, FS_BOLD);
             $graph->SetBox(false);
             $graph->ygrid->SetFill(false);
             $graph->yaxis->HideLine(false);
             $graph->yaxis->HideTicks(false, false);
             $graph->yaxis->HideZeroLabel();
             $graph->yaxis->title->Set(iconv("UTF-8", "GB2312//IGNORE", "得分"));
             $graph->yaxis->title->SetFont(FF_SIMSUN, FS_BOLD);
             $graph->xaxis->SetTickLabels($X);
             $graph->xaxis->SetFont(FF_SIMSUN, FS_BOLD);
             $graph->xaxis->title->Set(iconv("UTF-8", "GB2312//IGNORE", "日期"));
             $graph->xaxis->title->SetFont(FF_SIMSUN, FS_BOLD);
             $i = 0;
             $p = new LinePlot($datas);
             $graph->Add($p);
             $color = getColor($i++);
             $p->mark->SetType(MARK_FILLEDCIRCLE, '', 1.0);
             $p->mark->SetColor($color);
             $p->mark->SetFillColor($color);
             $p->SetCenter();
             $p->SetColor($color);
             $p->value->SetFormat('%d');
             $p->value->Show();
             $p->value->SetColor($color);
             $graph->Stroke();
             exit;
         } else {
             die("No graph, please check your params!");
         }
     }
 }
开发者ID:dalinhuang,项目名称:hteacher,代码行数:31,代码来源:graph.php


示例10: count

            $tabla = "reclamos";
            $id_proceso = "id_reclamo";
            break;
    }
    $objDB->execute("SET lc_time_names = 'es_VE';");
    $query = "SELECT nombre, count({$id_proceso}) AS total, id_usuario\n        FROM {$tabla}\n        INNER JOIN usuarios \n        WHERE usuarios.id_usuario = {$tabla}.idusuario\n        AND MONTHNAME(STR_TO_DATE(MONTH(fecha_registro), '%m'))='{$mes}'\n        AND year = '{$year}' \n        GROUP BY idusuario";
    $rs = $objDB->getRecords($query);
    $rows = array();
    $indice = 0;
    foreach ($rs as $data) {
        $total = $data['total'];
        $id_usuario = $data['id_usuario'];
        settype($total, int);
        settype($id_usuario, int);
        $indice = $indice + 1;
        $color = getColor($indice);
        array_push($rows, array("c" => array(array("v" => $data['nombre']), array("v" => $total), array("v" => $id_usuario), array("v" => $color))));
    }
    if (isset($_GET['tipoProceso'])) {
        $tipo_proceso = $_GET['tipoProceso'];
    }
    $cols = array(array("label" => "Nombre", "type" => "string"), array("label" => "Total por funcionario", "type" => "number"), array("label" => "Id Usuario", "type" => "number"), array("type" => "string", "role" => "style"));
    //$rows = array(array("c"=>array(array("v"=>$tipo_proceso), array("v"=>$total))));//,
    //              array("c"=>array(array("v"=>"Solicitudes"),array("v"=>$totSolicitudes))),
    //              array("c"=>array(array("v"=>"Denuncias"),array("v"=>$totDenuncias))),
    //              array("c"=>array(array("v"=>"Reclamos"),array("v"=>$totReclamos))));
    $data = array("cols" => $cols, "rows" => $rows);
    echo json_encode($data);
}
?>
开发者ID:szLuis,项目名称:oac,代码行数:30,代码来源:getUserChartData.php


示例11: drawPath

 function drawPath($myDoc, $name, $n, $weights)
 {
     global $doc, $SCALE, $dx, $dy;
     $path = $doc->createElement("path");
     $myD = "";
     if (isset($name) && $name != "") {
         $tree = $myDoc->getWeightedSubTree($name, $weights);
     } else {
         $tree = $myDoc->getWeightedTree($weights);
     }
     /*N
           $totalWeight = 0;
           for ($i=0; $i < count($tree); $i++) {
     	$totalWeight = $totalWeight + $weights[$tree[$i]->name];
           }*/
     drawAxis(count($tree));
     $angle = 0;
     for ($i = 0; $i < count($tree); $i++) {
         /*N $delta = $weights[$tree[$i]->name]*2*pi()/$totalWeight;
         	$angle_text = $angle + $delta/2;
         	$angle = $angle + $delta;
         	drawSingleAxis($angle);*/
         $myD .= $i == 0 ? "M" : "L";
         //N: should be commented
         $angle = ($i + 1) * 2 * pi() / count($tree);
         $x = $tree[$i]->score * $SCALE * cos($angle);
         $x = $x + $dx;
         $y = $tree[$i]->score * $SCALE * sin($angle);
         $y = $y + $dy;
         $myD .= " {$x} {$y} ";
         //2.1 = 2 + 0.1 of padding before actual text display
         //N: drawText(2.1*$SCALE*cos($angle_text), 2.1*$SCALE*sin($angle_text), $tree[$i]);
         drawText(2.1 * $SCALE * cos($angle), 2.1 * $SCALE * sin($angle), $tree[$i]);
     }
     $myD .= "z";
     $path->setAttribute("d", $myD);
     $path->setAttribute("fill", getColor($n));
     $path->setAttribute("fill-opacity", "0.2");
     $path->setAttribute("stroke-width", "3");
     $path->setAttribute("stroke", getColor($n));
     return $path;
 }
开发者ID:Nyco,项目名称:QSOS,代码行数:42,代码来源:QSOSComparison.php


示例12: BRIGHT

function BRIGHT($rgb, $mult = 1.5)
{
    getRGB($rgb, $r, $g, $b);
    $darker = false;
    if ($mult < 0) {
        $darker = true;
        $mult = -$mult;
    }
    $a = round(($r - 128) * $mult - ($r - 128));
    $ag = round(($g - 128) * $mult - ($g - 128));
    $ab = round(($b - 128) * $mult - ($b - 128));
    if (abs($ag) > abs($a)) {
        $a = $ag;
    }
    if (abs($ab) > abs($a)) {
        $a = $ab;
    }
    if ($darker) {
        $r = $r - $a;
        $g = $g - $a;
        $b = $b - $a;
    } else {
        $r = $r + $a;
        $g = $g + $a;
        $b = $b + $a;
    }
    $r = $r > 255 ? 255 : ($r < 0 ? 0 : $r);
    $g = $g > 255 ? 255 : ($g < 0 ? 0 : $g);
    $b = $b > 255 ? 255 : ($b < 0 ? 0 : $b);
    return getColor($r, $g, $b);
}
开发者ID:brocococonut,项目名称:yGallery,代码行数:31,代码来源:customthemes.php


示例13: getColor

		        		<td><input class="style_input" type="text" id="wordColor" name="wordColor" value="<?php 
        echo getColor("wordColor", "#000000");
        ?>
" /></td>
		        	</tr>
		        	<tr>
		        		<td class="style_title">边框颜色:</td>
		        		<td><input class="style_input" type="text" id="border" name="border" value="<?php 
        echo getColor("border", "#C7C5B8");
        ?>
" /></td>
		        	</tr>
		        	<tr>
		        		<td class="style_title">横条颜色:</td>
		        		<td><input class="style_input" type="text" id="line" name="line" value="<?php 
        echo getColor("line", "#FFFFFF");
        ?>
" /></td>
		        	</tr>
		        	<tr>
		        		<td colspan="2"><input type="submit" style="float:left;" class="submit_btn" value="保存" />
						<a href="setting.php?reset=true" class="link_btn" style="float:left;" >恢复默认</a>
		        		</td>
		        	</tr>
		        </table>
			</form>
			
		<?php 
    } else {
        if ($type == 1) {
            ?>
开发者ID:tianguanghui,项目名称:twitese,代码行数:31,代码来源:setting.php


示例14: preg_match_all

 }
 if ($process) {
     preg_match_all("/{[^{]*/", $s, $points);
     foreach ($points[0] as $point) {
         $point = rtrim($point);
         // remove possible trailing newline
         // 1: first half
         // 2: point ID
         // 3: P or L or ''
         // 4: second half
         // 5, 6, 7: x, y, z
         if (preg_match("/({([^}]*)} ?([PL])?)([^-0-9]*(-?[0-9]+\\.[0-9]*)[ ,]+(-?[0-9]+\\.[0-9]*)[ ,]+(-?[0-9]+\\.[0-9]*))/", $point, $parts)) {
             $x = $parts[5] + 0.0;
             $y = $parts[6] + 0.0;
             $z = $parts[7] + 0.0;
             $color = getColor($parts[2]);
             if ($hasPrev && $parts[3] != 'P') {
                 fwrite($stdout, "{}U {$prevColor} " . ($x + $prevX) / 2.0 . " " . ($y + $prevY) / 2.0 . " " . ($z + $prevZ) / 2.0 . "\n");
                 fwrite($stdout, "{$parts['1']} {$color} {$parts['4']}\n");
             } else {
                 fwrite($stdout, $point . "\n");
             }
             $hasPrev = TRUE;
             $prevX = $x;
             $prevY = $y;
             $prevZ = $z;
             $prevColor = $color;
         }
     }
 } else {
     fwrite($stdout, $s);
开发者ID:smlewis,项目名称:MolProbity,代码行数:31,代码来源:halfbonds.php


示例15: GraphSonda


//.........这里部分代码省略.........
                        $skip = true;
                    }
                    if (isset($_SESSION['filter']['P5']) && $row['value'] < $percentile['P5']) {
                        $skip = true;
                    }
                    if (!$skip) {
                        if (!isset($theSondaAvg[$tk])) {
                            $theSondaAvg[$tk] = array($tk, 0, 0);
                        }
                        if (!isset($theSondaQoE[$tk])) {
                            $theSondaQoE[$tk] = array($tk, 0, 0);
                        }
                        $sum = $theSondaAvg[$tk][1];
                        $cnt = $theSondaAvg[$tk][2];
                        $x = $sum + $row['value'];
                        $y = $cnt + 1;
                        $theSondaAvg[$tk] = array($tk, $x, $y);
                        if ($row['value'] > $nominal) {
                            $row['value'] = $nominal;
                        }
                        $sum = $theSondaQoE[$tk][1];
                        $cnt = $theSondaQoE[$tk][2];
                        $x = $sum + $row['value'];
                        $y = $cnt + 1;
                        $theSondaQoE[$tk] = array($tk, $x, $y);
                    }
                }
            }
            if (isset($theSondaAvg)) {
                aasort($theSondaAvg, 0);
                $next = 0;
                $prev = 0;
                foreach ($theSondaAvg as $tvalue) {
                    $next = $tvalue[0] + $offset;
                    if ($prev > 0 && $next > 0 && $next - $prev > $divide * 2) {
                        $dataAvg[] = array(($prev + 1000) * 1000, null);
                    }
                    $dataAvg[] = array($next * 1000, round($tvalue[1] / $tvalue[2] / $div, 2));
                    $prev = $next;
                }
                aasort($theSondaQoE, 0);
                $next = 0;
                $prev = 0;
                foreach ($theSondaQoE as $tvalue) {
                    $next = $tvalue[0] + $offset;
                    if ($prev > 0 && $next > 0 && $next - $prev > $divide * 2) {
                        $dataQoE[] = array(($prev + 1000) * 1000, null);
                    }
                    $dataQoE[] = array($next * 1000, round($tvalue[1] / $tvalue[2] / $div, 2));
                    $prev = $next;
                }
            }
            if (isset($dataAvg)) {
                if (!isset($minClock)) {
                    $minClock = $dataAvg[0][0];
                    $maxClock = $dataAvg[count($dataAvg) - 1][0];
                } else {
                    if ($dataAvg[0][0] < $minClock) {
                        $minClock = $dataAvg[0][0];
                    }
                    if ($dataAvg[count($dataAvg) - 2][0] > $maxClock) {
                        $maxClock = $dataAvg[count($dataAvg) - 2][0];
                    }
                }
                if ($_GET['qoe'] == 'Average On' || $_GET['qoe'] == 'Both') {
                    $chart->series[]->name = $hostName . "-AVG";
                    $chart->series[$index]->type = 'spline';
                    $chart->series[$index]->dashStyle = 'spline';
                    $chart->series[$index]->data = $dataAvg;
                    $chart->series[$index]->color = getColor($colorIndex);
                    $chart->series[$index]->lineWidth = 1;
                    $chart->series[$index]->marker->radius = 2;
                    $index++;
                }
                if ($_GET['qoe'] == 'QoE On' || $_GET['qoe'] == 'Both') {
                    $chart->series[]->name = $hostName . '-QoE';
                    $chart->series[$index]->type = 'shortdot';
                    $chart->series[$index]->color = getColor($colorIndex);
                    $chart->series[$index]->data = $dataQoE;
                    $chart->series[$index]->lineWidth = 1;
                    $chart->series[$index]->marker->radius = 2;
                    $index++;
                }
                $colorIndex++;
            }
        }
    }
    $title = 'Sondas for "' . $ldata['item'] . '" on plan "' . $ldata['plan'] . '"';
    $subtitle = 'From ' . $ldata['from'] . ' to ' . $ldata['to'];
    $chart = chartHeader($chart, $id_chart, $title, $subtitle, $ldata['unit'], null);
    if (!isset($minClock)) {
        $minClock = 0;
        $maxClock = 0;
    }
    $chart->xAxis->type = 'datetime';
    $chart->tooltip->formatter = new HighchartJsExpr("\n            function() {\n                var s = '<b>'+ Highcharts.dateFormat('%e. %b %H:%M',this.x) +'</b>';    \n                \$.each(this.points, function(i, point) {\n                    s += '<br/><span style=\"color:'+point.series.color+'\">'+ point.series.name +': '+ point.y +' " . $ldata['unit'] . "</span><b>';\n                });\n                return s;\n            }");
    echo "\n" . '<script> function redraw() { chart1.xAxis[0].setExtremes(' . $minClock . ', ' . (round($maxClock / (3600 * 24), 0) * 3600 * 24 + $divide * 1000) . ');}  </script>';
    //var_dump($chart->chart);
    return $chart;
}
开发者ID:rafaelurrutia,项目名称:bmonitor-y-bi,代码行数:101,代码来源:graphSonda.php


示例16: createGraph

function createGraph($itemids, $name, $width, $height, $graphtype, $func, $drawtype, $yaxisside)
{
    if (!$name) {
        error(_s('Warning. Incorrect value for field "%1$s"', '[name]'));
        return false;
    }
    if (!$graphtype) {
        $graphtype = 0;
    }
    if (!$width) {
        $width = 900;
    }
    if (!$height) {
        $height = 200;
    }
    // Check permissions
    if (!empty($itemids)) {
        $options = array('nodeids' => get_current_nodeid(true), 'itemids' => $itemids, 'filter' => array('flags' => array(ZBX_FLAG_DISCOVERY_NORMAL, ZBX_FLAG_DISCOVERY_CREATED)), 'webitems' => 1, 'editable' => 1, 'output' => API_OUTPUT_EXTEND);
        $items = API::Item()->get($options);
        $items = zbx_toHash($items, 'itemid');
        foreach ($itemids as $inum => $itemid) {
            if (!isset($items[$itemid])) {
                access_deny();
            }
        }
    }
    if (empty($items)) {
        info(_('Items required for graph'));
        return false;
    } else {
        $gitems = array();
        $num = 0;
        foreach ($items as $inum => $item) {
            if ($item['value_type'] != ITEM_VALUE_TYPE_UINT64 && $item['value_type'] != ITEM_VALUE_TYPE_FLOAT) {
                info(_s('Cannot create graph for non-numeric item, skipping "%1$s"', $item['name']));
                continue;
            }
            $gitem['itemid'] = $item['itemid'];
            $gitem['drawtype'] = $drawtype;
            $gitem['sortorder'] = $num;
            $gitem['color'] = getColor($num);
            $gitem['yaxisside'] = $yaxisside;
            $gitem['calc_fnc'] = $func;
            $gitem['type'] = 0;
            $gitems[] = $gitem;
            $num++;
        }
        $graph = array('name' => $name, 'width' => $width, 'height' => $height, 'ymin_type' => 0, 'ymax_type' => 0, 'yaxismin' => 0, 'yaxismax' => 0, 'ymin_itemid' => 0, 'ymax_itemid' => 0, 'show_work_period' => 1, 'show_triggers' => 1, 'graphtype' => $graphtype, 'show_legend' => 1, 'show_3d' => 0, 'percent_left' => 0, 'percent_right' => 0, 'gitems' => $gitems);
        $result = API::Graph()->create($graph);
        if ($result) {
            info(_('Graph added'));
            add_audit(AUDIT_ACTION_ADD, AUDIT_RESOURCE_GRAPH, 'Graph [' . $name . ']');
        } else {
            info(_('Cannot add graph'));
        }
    }
    return $result;
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:58,代码来源:snmp_builder.php


示例17: count

                    <?php 
    echo $suiteName;
    ?>
 : <span class="badge"><?php 
    echo count($suite['scenarios']);
    ?>
                        scenarios</span>
                </h3>
            </div>
            <div class="panel-body">
                <!-- Suite content -->
                <?php 
    foreach ($suite['scenarios'] as $scenario) {
        ?>
                    <div class="panel scenarios panel-<?php 
        echo getColor($scenario['scenarioStatus']);
        ?>
"
                         style="border: 0px solid #fff">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <span class="pull-left clickable scenario-collapse">
                                    <i class="glyphicon clickable glyphicon-th-list"></i>
                                </span>
                                <?php 
        echo " " . $scenario['name'] . " ";
        ?>
                                <span class="pull-right">
                                    <span class="badge"> time : <?php 
        echo $scenario['time'];
        ?>
开发者ID:zondor,项目名称:codeception-paracept-json-merge,代码行数:31,代码来源:report-template.php


示例18: glob

<?php

include 'picmatch.php';
$pic = 'match.jpg';
$images = glob('images/*.jpg');
$matchs = array();
foreach ($images as $img) {
    $color1 = getColor($pic);
    $color2 = getColor($img);
    $matchs[floor(match($color1, $color2))] = $img;
}
krsort($matchs);
echo '<img src="' . $pic . '" /><br>最相似的图片是:<hr>';
foreach ($matchs as $img) {
    echo '<img src="' . $img . '" />';
}
开发者ID:smartUI,项目名称:picmatch,代码行数:16,代码来源:match.php


示例19: foreach

 foreach ($arrData as $release => $versions) {
     $releaseExecCount = 0;
     $releaseBuildCount = 0;
     foreach ($versions[vers] as $version => $builds) {
         $versionExecCount = 0;
         foreach ($builds[blds] as $build => $runs) {
             $buildExecCount = 0;
             $pass = $fail = 0;
             foreach ($runs[run] as $scriptResultID => $execData) {
                 $buildExecCount++;
                 if ($execData[status] != "PASSED") {
                     $fail++;
                 } else {
                     $pass++;
                 }
                 $arrData[$release][vers][$version][blds][$build][run][$scriptResultID][color] = getColor($execData[status]);
             }
             $versionExecCount += $buildExecCount;
             $arrData[$release][vers][$version][blds][$build][exec_count] = $buildExecCount;
             $arrData[$release][vers][$version][blds][$build][p] = $pass;
             $arrData[$release][vers][$version][blds][$build][f] = $fail;
         }
         $releaseExecCount += $versionExecCount;
         $releaseBuildCount += count($builds[blds]);
         $arrData[$release][vers][$version][exec_count] = $versionExecCount;
         $arrData[$release][vers][$version][build_count] = count($builds[blds]);
     }
     $arrData[$release][exec_count] = $releaseExecCount;
     $arrData[$release][build_count] = $releaseBuildCount;
 }
 $rs = mysql_query("select caseName from cases where caseID=" . $caseID);
开发者ID:window98lsq,项目名称:autoweb,代码行数:31,代码来源:history.php


示例20: die

         die("-1");
     }
     var_dump(json_decode($_GET['data'], true));
     if ($data = json_decode($_GET['data'], true)) {
         getFileContent('./data/structure.json');
         $clustering = $content;
         $data['_color'] = array();
         $i = 0;
         foreach ($data as $key => $value) {
             $i++;
             foreach ($clustering['setup'] as $eachCluster) {
                 if ($eachCluster['name'] == $key) {
                     if ($eachCluster['type'] == 'choice') {
                         for ($j = 0; $j < count($eachCluster['choice']); $j++) {
                             if ($eachCluster['choice'][$j]['value'] == $value) {
                                 $data["_color"][md5($key)] = getColor($j + $i * 2);
                                 break;
                             }
                         }
                     }
                     break;
                 }
             }
         }
         if ($connect->query("update shortcircuit_each_info set info='" . json_encode($data, JSON_UNESCAPED_UNICODE) . "' where hash='{$hash}'")) {
             die("ok");
         } else {
             die($connect->error());
         }
     }
 }
开发者ID:neungkl,项目名称:short-circuit,代码行数:31,代码来源:flow.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getColumnFields函数代码示例发布时间:2022-05-15
下一篇:
PHP getCodelangue函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap