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


PHP LinePlot::SetStepStyle方法代码示例

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


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

示例1: array

<?php

include "../jpgraph.php";
include "../jpgraph_line.php";
$ydata = array(11, 3, 8, 12, 5, 1, 9, 13, 5, 7);
$y2data = array(354, 200, 265, 99, 111, 91, 198, 225, 293, 251);
// Create the graph and specify the scale for both Y-axis
$graph = new Graph(300, 240, "auto");
$graph->SetScale("textlin");
$graph->SetShadow();
// Adjust the margin
$graph->img->SetMargin(40, 40, 20, 70);
// Create the two linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetStepStyle();
// Adjust the axis color
$graph->yaxis->SetColor("blue");
$graph->title->Set("Example 6.2");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
// Set the colors for the plots
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
// Set the legends for the plots
$lineplot->SetLegend("Plot 1");
// Add the plot to the graph
$graph->Add($lineplot);
// Adjust the legend position
开发者ID:tavo1981,项目名称:phpbar,代码行数:31,代码来源:example6.2.php

示例2: array

<?php

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_line.php';
$datay = array(20, 10, 35, 5, 17, 35, 22);
// Setup the graph
$graph = new Graph(400, 200);
$graph->SetMargin(40, 40, 20, 30);
$graph->SetScale("intlin");
$graph->SetBox();
$graph->SetMarginColor('darkgreen@0.8');
// Setup a background gradient image
$graph->SetBackgroundGradient('darkred', 'yellow', GRAD_HOR, BGRAD_PLOT);
$graph->title->Set('Gradient filled line plot ex2');
$graph->yscale->SetAutoMin(0);
// Create the line
$p1 = new LinePlot($datay);
$p1->SetFillGradient('white', 'darkgreen');
$p1->SetStepStyle();
$graph->Add($p1);
// Output line
$graph->Stroke();
?>


开发者ID:trabisdementia,项目名称:xuups,代码行数:24,代码来源:gradlinefillex4.php

示例3: LinePlot

$graph->xaxis->SetLabelAngle(90);
if ($_GET['unit']) {
    $graph->yaxis->title->Set($_GET['unit']);
}
if (!$date_format) {
    $date_format = 'H:i';
}
$graph->xaxis->scale->SetDateFormat($date_format);
//$graph->SetTickDensity(TICKD_DENSE);
$line = new LinePlot($ydata, $xdata);
//$line->SetLegend('Year 2005');
if ($all_positive) {
    $line->SetFillColor('lightblue@0.5');
}
if ($binary_data) {
    $line->SetStepStyle();
}
$graph->Add($line);
$graph->SetShadow();
$graph->Stroke();
/*
 $Test = new pChart($w,$h);  

 if ($_GET['gcolor']=='red') {
  $Test->setColorPalette(0,220,50,50);
 } elseif ($_GET['gcolor']=='brown') {
  $Test->setColorPalette(0,220,140,100);
 } elseif ($_GET['gcolor']=='blue') {
  $Test->setColorPalette(0,100,140,220);
 } elseif ($_GET['gcolor']=='green') {
  $Test->setColorPalette(0,100,220,140);
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:index.php

示例4: displayGraph


//.........这里部分代码省略.........
    // L I N E P L O T
    if (sizeof($G_YDATAS) >= 1) {
        // true no funciona porque cada cadena u otro valor que se retorne es valor "valido o verdadero"
        // y equivale a true, entonces para diferenciarlo verdaderamente se compara con 'true'
        $str = checkAttributes($G_TITLE, $G_TYPE, $G_LABEL_Y, $_MSJ_ERROR, $_MSJ_NOTHING);
        if ($str != 'true') {
            showError($str, $G_SIZE);
            return;
        }
        if ($G_TYPE == 'lineplot') {
            $graph = new Graph($G_SIZE[0], $G_SIZE[1], "auto");
            if ($G_SHADOW) {
                $graph->SetShadow();
            }
            $graph->SetScale($G_SCALE);
            $graph->SetMarginColor($G_COLOR);
            $graph->title->Set($G_TITLE);
            $graph->SetFrame(true, '#999999');
            $graph->img->SetMargin($G_MARGIN[0], $G_MARGIN[1], $G_MARGIN[2], $G_MARGIN[3]);
            $graph->img->SetAntiAliasing();
            $graph->xaxis->SetLabelFormatCallback("CallBack");
            $graph->xaxis->SetLabelAngle(90);
            $graph->xaxis->title->Set($G_LABEL[0]);
            $graph->yaxis->title->Set($G_LABEL[1]);
            $graph->xgrid->Show();
            $graph->legend->SetFillColor("#fafafa");
            $graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
            $graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
            $graph->legend->SetColor("#444444", "#999999");
            $arr_lineplot = array();
            foreach ($G_YDATAS as $num => $yDatas) {
                $lineplot = new LinePlot($yDatas);
                if ($G_ARR_STEP[$num] == true) {
                    $lineplot->SetStepStyle();
                }
                if ($G_ARR_FILL_COLOR[$num] == true) {
                    $lineplot->SetFillColor($G_ARR_COLOR[$num]);
                }
                $lineplot->SetColor($G_ARR_COLOR[$num]);
                $lineplot->SetWeight($G_WEIGHT);
                $lineplot->SetLegend($G_ARR_LEYEND[$num]);
                $arr_lineplot[] = $lineplot;
            }
            foreach ($arr_lineplot as $num => $yDatas) {
                $graph->Add($yDatas);
            }
            if (sizeof($xData) > 100) {
                $graph->xaxis->SetTextTickInterval((int) (sizeof($xData) / 10));
            }
            $graph->Stroke();
        } else {
            if ($G_TYPE == 'plot3d') {
                $graph = new PieGraph($G_SIZE[0], $G_SIZE[1], "auto");
                if ($G_SHADOW) {
                    $graph->SetShadow();
                }
                $dataMarginColor = isset($result["ATTRIBUTES"]["MARGIN_COLOR"]) ? $result["ATTRIBUTES"]["MARGIN_COLOR"] : "#999999";
                $dataSizePie = isset($result["ATTRIBUTES"]["SIZE_PIE"]) ? $result["ATTRIBUTES"]["SIZE_PIE"] : "80";
                $graph->SetMarginColor($G_COLOR);
                $graph->SetFrame(true, $dataMarginColor);
                $graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
                $graph->legend->SetFillColor("#fafafa");
                $graph->legend->SetColor("#444444", "#999999");
                $graph->legend->SetShadow('gray@0.6', 4);
                $graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
                $graph->title->Set($G_TITLE);
开发者ID:hardikk,项目名称:HNH,代码行数:67,代码来源:paloSantoGraphImage.lib.php

示例5: LinePlot

$graph3->SetMarginColor(BKG_COLOR);
$graph3->SetFrame(true, 'white', 0);
$graph3->SetBox();
$graph3->title->Set('Temperature');
$graph3->title->SetColor('black');
$graph3->title->SetFont(FF_ARIAL, FS_BOLD, 14);
$graph3->title->SetMargin(5);
$graph3->xaxis->HideLabels();
$graph3->xgrid->Show();
$graph3->yaxis->SetLabelAngle(90);
$graph3->yaxis->SetColor('black');
$graph3->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph3->yaxis->SetLabelMargin(0);
$graph3->yaxis->scale->SetAutoMin(-10);
$line3 = new LinePlot($data_windtemp, $xdata);
$line3->SetStepStyle();
$line3->SetColor('black');
$graph3->Add($line3);
//-----------------------
// Create a multigraph
//----------------------
$mgraph = new MGraph();
$mgraph->SetMargin(2, 2, 2, 2);
$mgraph->SetFrame(true, 'darkgray', 2);
$mgraph->SetFillColor(BKG_COLOR);
$mgraph->Add($graph, 0, 50);
$mgraph->Add($graph2, 250, 50);
$mgraph->Add($graph3, 460, 50);
$mgraph->title->Set('Climate diagram 12 March 2009');
$mgraph->title->SetFont(FF_ARIAL, FS_BOLD, 20);
$mgraph->title->SetMargin(8);
开发者ID:hcvcastro,项目名称:pxp,代码行数:31,代码来源:comb90dategraphex03.php

示例6: LinePlot

} else {
    $lineplot = new LinePlot($ydata, $xdata);
}
//	echo '<pre>';
//	$i = 0;
//	foreach ($xdata as $date){
//		echo $i . ' | ' . $date . ' | ' . date('j-m-Y',$date) . ' | ' . $ydata[$i] . "\n";
//		$i++;
//	}
//
//
//	echo '</pre>';
$lineplot->SetColor('blue');
$lineplot->SetFillColor("blue@0.8");
if ($starttime > strtotime('-13 months', $endtime)) {
    $lineplot->SetStepStyle(true);
}
$orangeline = new PlotLine(HORIZONTAL, $aantalbedden * 0.8, 'orange', 1);
$redline = new PlotLine(HORIZONTAL, $aantalbedden * 0.9, 'red', 1);
$maxline = new PlotLine(HORIZONTAL, $aantalbedden, 'black', 1);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddLine($orangeline);
$graph->AddLine($redline);
$graph->AddLine($maxline);
if ($starttime < strtotime('-6 months', $endtime)) {
    // Trend
    $prec = floor(count($ydata) / 10);
    //echo $prec . '<br />';
    $avg = array();
    for ($i = 0; $i < count($ydata); $i++) {
开发者ID:nephie,项目名称:AZL-website,代码行数:31,代码来源:bedbezgraph.php

示例7: addData

 /**
  * adds new plot to the graph
  *
  * @param $obj
  * @param $data
  */
 public function addData($interpreter)
 {
     if (is_null($interpreter->getTupleCount())) {
         $interpreter->setTupleCount($this->width);
     }
     $data = $interpreter->processData(function ($tuple) {
         $tuple[0] /= 1000;
         return $tuple;
     });
     if (count($data) > 0) {
         $xData = $yData = array();
         // TODO adjust x-Axis
         foreach ($data as $reading) {
             $xData[] = $reading[0];
             $yData[] = $reading[1];
         }
         // Create the scatter plot
         $plot = new \LinePlot($yData, $xData);
         $plot->setLegend($interpreter->getEntity()->getProperty('title') . ':  [' . $interpreter->getEntity()->getDefinition()->getUnit() . ']');
         $plot->SetColor($this->colors[$this->count]);
         $plot->SetStepStyle($interpreter instanceof Interpreter\MeterInterpreter);
         $axis = $this->getAxisIndex($interpreter->getEntity());
         if ($axis >= 0) {
             $this->graph->AddY($axis, $plot);
         } else {
             $this->graph->Add($plot);
         }
         $this->count++;
     }
 }
开发者ID:rgr-rgr,项目名称:volkszaehler.org,代码行数:36,代码来源:JpGraph.php

示例8: Graph

$graph2 = new Graph(WIND_WIDTH - 30, WIND_HEIGHT);
$graph2->SetScale('datlin');
$graph2->Set90AndMargin(5, 20, 60, 30);
$graph2->SetMarginColor(BKG_COLOR);
$graph2->SetFrame(true, 'white', 0);
$graph2->SetBox();
$graph2->title->Set('Windspeed');
$graph2->title->SetColor('red');
$graph2->title->SetFont(FF_ARIAL, FS_BOLD, 14);
$graph2->title->SetMargin(5);
$graph2->xaxis->HideLabels();
$graph2->xgrid->Show();
$graph2->yaxis->SetLabelAngle(90);
$graph2->yaxis->SetColor('red');
$graph2->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph2->yaxis->SetLabelMargin(0);
$graph2->yaxis->scale->SetAutoMin(0);
$line2 = new LinePlot($data_windspeed, $xdata);
$line2->SetStepStyle();
$line2->SetColor('red');
$graph2->Add($line2);
//-----------------------
// Create a multigraph
//----------------------
$mgraph = new MGraph();
$mgraph->SetMargin(2, 2, 2, 2);
$mgraph->SetFrame(true, 'darkgray', 2);
$mgraph->SetFillColor(BKG_COLOR);
$mgraph->Add($graph);
$mgraph->Add($graph2, 280, 0);
$mgraph->Stroke();
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:31,代码来源:comb90dategraphex02.php

示例9: LinePlot

$graph->yaxis->SetColor("blue");
$graph->y2axis->scale->SetGrace(10, 0);
$graph->y2axis->SetColor("darkgreen");
$lineCaches = new LinePlot($yDataCaches, $xDate);
$lineCaches->SetLegend(tr("graph_statistics_02"));
$lineCaches->SetColor("blue");
$lineCaches->SetStyle("solid");
$lineCaches->SetWeight(3);
$lineCaches->SetStepStyle();
$graph->Add($lineCaches);
$lineFound = new LinePlot($yDataLogs, $xDate);
$lineFound->SetLegend(tr("graph_statistics_03"));
$lineFound->SetColor("darkgreen");
$lineFound->SetStyle("solid");
$lineFound->SetWeight(2);
$lineFound->SetStepStyle();
$graph->AddY2($lineFound);
//
// Infotexte einfuegen
//
$txtStat1 = new Text(tr('graph_statistics_04') . strftime('%d-%m-%Y', time()));
$txtStat1->SetPos(55, 55);
$txtStat1->SetFont(FF_ARIAL, FS_NORMAL, 10);
$lineHeight = $txtStat1->GetFontHeight($graph->img);
$hiddenCaches = XDb::xSimpleQueryValue("SELECT COUNT(*) FROM `caches` WHERE (`status`=1 OR `status`=2 OR `status`=3)", 0);
$txtStat2 = new Text(tr('graph_statistics_05') . str_replace(',', '.', number_format($hiddenCaches)));
$txtStat2->SetPos(55, 55 + $lineHeight * 1.5);
$txtStat2->SetFont(FF_ARIAL, FS_NORMAL, 8);
$txtStat2->SetColor('blue');
$activeCaches = XDb::xSimpleQueryValue("SELECT COUNT(*) FROM `caches` WHERE `status`=1", 0);
$txtStat3 = new Text(tr('graph_statistics_06') . str_replace(',', '.', number_format($activeCaches)));
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:new-caches-oc.php

示例10: grafic_queue

function grafic_queue(&$pDB_ast_cdr, &$pDB_ast, $queue, $dti, $dtf)
{
    global $arrConf;
    $ancho = "700";
    $margenDerecho = "100";
    //============================================================================
    $objPalo_AST_CDR = new paloSantoExtention($pDB_ast_cdr);
    /*
     *   VALORES POR GET
     */
    $arrData = array();
    $numResults = 0;
    $arrValue = array();
    $arrTimestamp = array();
    //============================================================================
    include_once "libs/paloSantoQueue.class.php";
    $paloQueue = new paloQueue($pDB_ast);
    $arrResult = strlen($queue) != 0 ? $paloQueue->getQueue($queue) : $paloQueue->getQueue();
    //$arrResult
    //Array ( [0] => Array ( [0] => 2000 [1] => 2000 Recepcion )
    //        [1] => Array ( [0] => 5000 [1] => 5000 Soporte )
    //        [2] => Array ( [0] => 7000 [1] => 7000 Ventas )  )
    /*
     *   SE CREA UN 2 ARREGLOS DE TAMAÑO 3*X+1
     *   $arrData PARA LOS DATOS DEL EJE Y
     *   $arrayX PARA EL ARREGLO DE DATOS PARA EL EJE X
     */
    $arrayX = array();
    $num = sizeof($arrResult);
    $i = 0;
    for ($i = 1; $i <= $num; $i++) {
        $s = $arrResult[$i - 1];
        $s_0 = array(0 => "", 1 => "");
        if ($i == 1) {
            $arrData[0] = $s_0;
            $arrayX[0] = "";
        }
        $arrData[3 * ($i - 1) + 1] = $s;
        $arrayX[3 * ($i - 1) + 1] = "";
        $arrData[3 * ($i - 1) + 2] = $s;
        $arrayX[3 * ($i - 1) + 2] = $s[0];
        $arrData[3 * ($i - 1) + 3] = $s_0;
        $arrayX[3 * ($i - 1) + 3] = "";
        if ($i == $num) {
            $arrData[3 * ($i - 1) + 4] = $s_0;
            $arrayX[3 * ($i - 1) + 4] = "";
        }
    }
    //======================================================
    $graph = new Graph($ancho, 250);
    $graph->SetMargin(50, $margenDerecho, 30, 40);
    $graph->SetMarginColor('#fafafa');
    $graph->SetFrame(true, '#999999');
    $graph->legend->SetFillColor("#fafafa");
    $graph->legend->Pos(0.012, 0.5, "right", "center");
    $graph->legend->SetColor("#444444", "#999999");
    $graph->legend->SetShadow('gray@0.6', 4);
    $graph->title->SetColor("#444444");
    // Especifico la escala
    $graph->SetScale("intlin");
    $graph->title->Set(utf8_decode(_tr("Number Calls vs Queues")));
    $graph->xaxis->SetLabelFormatCallback('NameQueue');
    $graph->xaxis->SetLabelAngle(90);
    $graph->xaxis->SetColor("#666666", "#444444");
    if (is_array($arrData) && count($arrData) > 0) {
        foreach ($arrData as $k => $arrMuestra) {
            $arrTimestamp[$k] = $k;
            /* X */
            //$arr = $objPalo_AST_CDR->countQueue( $arrMuestra['id'], $dti, $dtf);
            $arr = $objPalo_AST_CDR->countQueue($arrMuestra[0], $dti, $dtf);
            $arrValue[$k] = $arr[0];
            /* Y */
        }
        if (count($arrTimestamp) > 0) {
            $numResults++;
            $line = new LinePlot($arrValue, $arrTimestamp);
            $line->SetStepStyle();
            $line->SetColor("#00cc00");
            $line->setFillColor("#00cc00");
            $line->SetLegend("# " . _tr("Calls"));
            $graph->Add($line);
            $graph->yaxis->SetColor("#00cc00");
        }
    }
    //======================================================================================
    if ($numResults > 0) {
        $graph->Stroke();
    } else {
        $graph = new CanvasGraph(500, 140, "auto");
        $title = new Text(utf8_decode(_tr("No records found")));
        $title->ParagraphAlign('center');
        $title->SetFont(FF_FONT2, FS_BOLD);
        $title->SetMargin(3);
        $title->SetAlign('center');
        $title->Center(0, 500, 70);
        $graph->AddText($title);
        $t1 = new Text(utf8_decode(_tr("There are no data to present")));
        $t1->SetBox("white", "black", true);
        $t1->ParagraphAlign("center");
        $t1->SetColor("black");
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例11: make_historybyteam

function make_historybyteam($teamcode = "")
{
    global $dbh, $rev, $outdir, $m_teams;
    $results = @mysql_query("SELECT sdate, SUM(translated) AS translated, SUM(total) AS total " . " FROM essential WHERE rev='{$rev}' AND team='{$teamcode}' " . " GROUP BY sdate ORDER BY sdate LIMIT 0,60", $dbh);
    if (!$results) {
        send_err("SQL error: historybyrev rev={$rev}; teamcode={$teamcode}");
        exit;
    }
    $points_x = array();
    $points_y = array();
    $my_y = -1;
    while ($row = @mysql_fetch_array($results)) {
        $points_x[] = pretty_date($row['sdate']);
        if ($my_y == -1) {
            $my_y = $row['translated'];
        } else {
            if ($my_y == -1) {
                $my_y = 0;
            }
            $points_y[] = $row['translated'] - $my_y;
            $my_y = $row['translated'];
        }
    }
    if (count($points_y) < 1) {
        return;
    }
    $teamname = $m_teams[$teamcode];
    list($graph1, $graph2) = init_graphs();
    $lineplot = new LinePlot($points_y);
    $lineplot->SetColor('blueviolet');
    $lineplot->SetStepStyle();
    $graph1->xaxis->SetTickLabels($points_x);
    $graph1->Add($lineplot);
    $graph1->title->Set("Essential files history for {$teamname} team");
    $graph1->Stroke("{$outdir}/{$rev}/{$teamcode}/essential.png");
    $graph2->xaxis->SetTickLabels($points_x);
    $graph2->Add($lineplot);
    $graph2->title->Set("Essential files history for {$teamname} team");
    $graph2->Stroke("{$outdir}/{$rev}/{$teamcode}/essential-big.png");
    destroy_graphs(array($graph1, $graph2));
}
开发者ID:teammember8,项目名称:roundcube,代码行数:41,代码来源:history-functions.php


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