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


PHP LinePlot::SetStyle方法代码示例

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


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

示例1: PlotLine

// Set legend box specification
$graph->legend->SetFillColor("white");
$graph->legend->SetLineWeight(2);
// Set X-axis at the minimum value of Y-axis (default will be at 0)
$graph->xaxis->SetPos("min");
// "min" will position the x-axis at the minimum value of the Y-axis
// Extend the margin for the labels on the Y-axis and reverse the direction
// of the ticks on the Y-axis
$graph->yaxis->SetLabelMargin(12);
$graph->xaxis->SetLabelMargin(6);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->xaxis->SetTickSide(SIDE_DOWN);
// Add mark graph with static lines
$line = new PlotLine(HORIZONTAL, 0, "black", 2);
$graph->AddLine($line);
// Create a new impuls type scatter plot
$sp1 = new ScatterPlot($datay, $datax);
$sp1->mark->SetType(MARK_SQUARE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(3);
$sp1->SetImpuls();
$sp1->SetColor("blue");
$sp1->SetWeight(1);
$sp1->SetLegend("Non-causal signal");
$graph->Add($sp1);
// Create the envelope plot
$ep1 = new LinePlot($datayenv, $datax);
$ep1->SetStyle("dotted");
$ep1->SetLegend("Positive envelope");
$graph->Add($ep1);
$graph->Stroke();
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:impulsex4.php

示例2: LinePlot

$lineplot2->SetLegend("4 in");
// Create the linear plot
$lineplot3 = new LinePlot($ydata3);
$lineplot3->SetColor("chocolate4");
$lineplot3->SetLegend("8 in");
$lineplot3->SetStyle("dashed");
// Create the linear plot
$lineplot4 = new LinePlot($ydata4);
$lineplot4->SetColor("blue");
$lineplot4->SetLegend("20 in");
// Create the linear plot
$lineplotA = new LinePlot($ydataA);
$lineplotA->SetColor("black");
$lineplotA->SetLegend("2m Air");
// Create the linear plot
$lineplot5 = new LinePlot($ydata5);
$lineplot5->SetColor("black");
$lineplot5->SetLegend("40 in");
$lineplot5->SetStyle("dotted");
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.1, 0.06, "right", "top");
// Add the plot to the graph
$graph->Add($lineplot1);
$graph->Add($lineplot2);
$graph->Add($lineplot3);
$graph->Add($lineplot4);
$graph->Add($lineplot5);
$graph->Add($lineplotA);
$graph->AddY2($lineplot);
// Display the graph
$graph->Stroke();
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:radn5temps2.php

示例3: genererCourbe

/**
 * Un tableau contenant les moyennes des eleves pour chaque sequences
 * 
 * @param type $moyennes = array()
 */
function genererCourbe($moyennes, $rang, $codeperiode = "S")
{
    try {
        # Donnees de la courbe
        $ydata = $moyennes;
        $ydata2 = $moyennes;
        /* for ($i = 1; $i <= 6; $i++) {
           $r = rand(0, 20);
           $ydata[] = $r;
           $ydata2[] = $r;
           } */
        /** Definition des label de l'axe x */
        if ($codeperiode === "T") {
            $datax = array("TRIM1", "TRIM2", "TRIM3");
        } else {
            $datax = array("seq 1", "seq 2", "seq 3", "seq 4", "seq 5", "seq 6");
        }
        # Creation du graph
        $graph = new Graph(350, 250, 'auto');
        $graph->SetMarginColor('white');
        # Definir le max et le min des valeur X
        $graph->SetScale('textlin', 0, 20);
        #$graph->xaxis->title->Set("Séquences");
        $graph->yaxis->title->SetFont(FF_ARIAL, FS_BOLD, 12);
        $graph->yaxis->title->Set("Moyennes");
        $graph->xaxis->SetTickLabels($datax);
        $graph->xaxis->title->SetFont(FF_ARIAL, FS_BOLD, 12);
        if ($codeperiode === "T") {
            $graph->xaxis->SetTitle("Trimestres", "middle");
        } else {
            $graph->xaxis->SetTitle("Séquences", "middle");
        }
        $graph->SetBackgroundGradient('white', 'lightblue', GRAD_HOR, BGRAD_PLOT);
        # Adjuster les margins (left, right, top, bottom)
        $graph->SetMargin(40, 5, 21, 45);
        # Box autour du plotarea
        $graph->SetBox();
        # Un cadre ou frame autour de l'image
        $graph->SetFrame(false);
        # Definir le titre tabulaire
        $graph->tabtitle->SetFont(FF_ARIAL, FS_BOLD, 8);
        $graph->tabtitle->Set($_SESSION['anneeacademique']);
        # Definir le titre du graphe
        $graph->title->SetFont(FF_VERDANA, FS_BOLD, 8);
        $graph->title->SetAlign("right");
        if (count($ydata) > 1) {
            $prev = $ydata[count($ydata) - 2];
            if ($prev < $ydata[count($ydata) - 1]) {
                $graph->title->Set("Performance en hausse");
            } elseif ($prev == $ydata[count($ydata) - 1]) {
                $graph->title->Set("Performance constante");
            } else {
                $graph->title->Set("Performance en baisse");
            }
        }
        # Definir les grid X et Y
        $graph->ygrid->SetFill(true, '#BBBBBB@0.9', '#FFFFFF@0.9');
        //$graph->ygrid->SetLineStyle('dashed');
        //$graph->ygrid->SetColor('gray');
        //$graph->xgrid->SetLineStyle('dashed');
        $graph->xgrid->SetColor('gray');
        $graph->xgrid->Show();
        //$graph->ygrid->Show();
        #$graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_MARGIN);
        $graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
        $graph->xaxis->SetLabelAngle(0);
        # Creation d'une bar pot
        $bplot = new BarPlot($ydata);
        $bplot->SetWidth(0.9);
        $fcol = '#440000';
        $tcol = '#FF9090';
        $bplot->SetFillGradient($fcol, $tcol, GRAD_LEFT_REFLECTION);
        # Set line weigth to 0 so that there are no border around each bar
        $bplot->SetWeight(0);
        # Create filled line plot
        $lplot = new LinePlot($ydata2);
        $lplot->SetFillColor('skyblue@0.5');
        $lplot->SetStyle(1);
        $lplot->SetColor('navy@0.7');
        $lplot->SetBarCenter();
        $lplot->mark->SetType(MARK_SQUARE);
        $lplot->mark->SetColor('blue@0.5');
        $lplot->mark->SetFillColor('lightblue');
        $lplot->mark->SetSize(5);
        # Afficher les moyenne au dessus des barres
        $accbarplot = new AccBarPlot(array($bplot));
        $accbarplot->value->SetFormat("%.2f");
        $accbarplot->value->Show();
        $graph->Add($accbarplot);
        $graph->SetBackgroundImageMix(50);
        # Definir un fond d'ecran pour l'image
        $background = SITE_ROOT . "public/photos/eleves/" . $rang['PHOTOEL'];
        if (!empty($rang['PHOTOEL']) && file_exists(ROOT . DS . "public" . DS . "photos" . DS . "eleves" . DS . $rang['PHOTOEL'])) {
            $graph->SetBackgroundImage($background, BGIMG_FILLPLOT);
            # $icon = new IconPlot($background, 25, 25, 0.8, 50);
//.........这里部分代码省略.........
开发者ID:jpainam,项目名称:locan,代码行数:101,代码来源:Functions2.php

示例4: array

<?php

include "../jpgraph.php";
include "../jpgraph_line.php";
$ydata = array(11, 3, 8, 12, 5, 1, 9, 13, 5, 7);
// Create the graph. These two calls are always required
$graph = new Graph(350, 250, "auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(30, 90, 40, 50);
$graph->xaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->title->Set("Dashed lineplot");
// Create the linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetLegend("Test 1");
$lineplot->SetColor("blue");
// Style can also be specified as SetStyle([1|2|3|4]) or
// SetStyle("solid"|"dotted"|"dashed"|"lobgdashed")
$lineplot->SetStyle("dashed");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
开发者ID:centaurustech,项目名称:BenFund,代码行数:22,代码来源:example1.2.php

示例5: templateGraph


//.........这里部分代码省略.........
             //				$first[$siteid] = $percent;
             if (!$this->withZoom) {
                 $xdata[$userid][$siteid][] = $start;
                 $ydata[$userid][$siteid][] = $percent;
             }
         }
         $xdata[$userid][$siteid][] = $time;
         $ydata[$userid][$siteid][] = $percent;
         $ylast[$userid][$siteid] = $percent;
         $no_data = false;
     }
     if (!$this->withZoom) {
         foreach (array_keys($ydata[$uid1]) as $siteid) {
             $xdata[$uid1][$siteid][] = $end;
             $ydata[$uid1][$siteid][] = $ylast[$uid1][$siteid];
         }
         if (isset($ydata[$uid2])) {
             foreach (array_keys($ydata[$uid2]) as $siteid) {
                 $xdata[$uid2][$siteid][] = $end;
                 $ydata[$uid2][$siteid][] = $ylast[$uid2][$siteid];
             }
         }
     }
     //		$xdata[$siteid][] = $end;
     //		$ydata[$siteid][] = $percent;
     //		$ylast[$siteid] = $percent;
     //		foreach ($sites2 as $siteid)
     //		{
     //			$xdata[$siteid][] = $end;
     //			$ydata[$siteid][] = isset($ylast[$siteid]) ;
     //		}
     //define the graph
     $dateformat = "d.M.y";
     $datemargin = strlen(date($dateformat)) * 11;
     //		$graph = new Graph($this->module->cfgGraphWidth()*2, $this->module->cfgGraphHeight()*2);
     $graph = new Graph($this->width, $this->height);
     if ($no_data) {
         $graph->SetScale('textint', 0, 100, 0, 1);
     } else {
         $graph->SetScale('datlin', 0, 100);
         $graph->xaxis->scale->SetDateFormat($dateformat);
     }
     $graph->SetColor(array(238, 238, 238));
     $graph->SetMarginColor(array(208, 211, 237));
     $graph->title->Set($this->getGraphTitle());
     $graph->yaxis->title->Set($this->module->lang('percentage'));
     $graph->SetShadow();
     $graph->xaxis->SetLabelAngle(90);
     $graph->img->SetMargin(40, 170, 20, $datemargin);
     //		$graph->img->SetMargin(40, 140, 0, $datemargin);
     $graph->legend->Pos(0.015, 0.05, "right", "top");
     $weights = array($uid1 => 3, $uid2 => 1);
     $labeled = array();
     //make a line for each site (and user)
     foreach ($ydata as $userid => $ydata2) {
         $curr_weight = $weights[$userid];
         foreach ($ydata2 as $siteid => $data) {
             //			var_dump($data);
             if (!isset($this->sites[$siteid])) {
                 continue;
             }
             $site = $this->sites[$siteid];
             $site instanceof WC_Site;
             $lineplot = new LinePlot($data, $xdata[$userid][$siteid]);
             list($color, $style) = $this->getColorAndStyle($site);
             $lineplot->SetStyle($style);
             $lineplot->SetColor($color);
             $lineplot->SetWeight($curr_weight);
             if ($this->withNumbers) {
                 $lineplot->value->Show();
             }
             if ($this->withIcons) {
                 $path = 'dbimg/logo_gif/' . $siteid . '.gif';
                 if (is_readable($path)) {
                     $lineplot->mark->SetType(MARK_IMG, $path, 0.5);
                 }
             }
             if (!in_array($siteid, $labeled, true)) {
                 $lineplot->SetLegend($site->getVar('site_name'));
                 $labeled[] = $siteid;
             }
             $graph->Add($lineplot);
         }
     }
     //		$graph->img->SetAntiAliasing();
     if ($no_data) {
         if (count($this->sites) === 0) {
             $text = $this->module->lang('err_no_sites');
         } else {
             $text = $this->module->lang('err_graph_empty');
         }
         $txt = new Text($text);
         //			$txt->SetFont(FF_ARIAL,FS_NORMAL,18);
         $txt->SetColor("#0000ff");
         $txt->SetPos(0.45, 0.45, 'center', 'center');
         $graph->AddText($txt);
     }
     $graph->Stroke();
     die;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:101,代码来源:GraphStats.php

示例6: LinePlot

$graph->xaxis->SetTextLabelInterval(12);
$graph->yaxis->scale->SetGrace(10, 0);
$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');
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:new-caches-oc.php

示例7: Temp

$bp1->SetFillColor("blue");
$bp1->SetLegend("Low Temp (F)");

$gbplot = new GroupBarPlot(array($bp0,$bp1));
$gbplot->SetWidth(0.9);
*/
$l1 = new LinePlot($y1);
$l1->SetColor("red");
$l1->SetWeight(2);
$l1->SetLegend("High Temp");
$l1->SetStyle('dashed');
$l2 = new LinePlot($y2);
$l2->SetColor("blue");
$l2->SetWeight(2);
$l2->SetLegend("Low Temp");
$l2->SetStyle('dashed');
$lp1 = new LinePlot($cy1);
$lp1->SetColor("red");
$lp1->SetLegend("CDF (high temp)");
$lp1->AddArea($h5, $h95, LP_AREA_NOT_FILLED, "lightred");
$lp1->AddArea($hm, $hm, LP_AREA_FILLED, "lightred");
$lp1->SetWeight(2);
$lp2 = new LinePlot($cy2);
$lp2->SetColor("blue");
$lp2->SetLegend("CDF (low temp)");
$lp2->AddArea($l5, $l95, LP_AREA_NOT_FILLED, "lightblue");
$lp2->AddArea($lm, $lm, LP_AREA_FILLED, "lightblue");
$lp2->SetWeight(2);
// Add the plot to the graph
//$graph->Add($gbplot);
$graph->AddY2($l1);
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:gspread.php


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