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


PHP LinePlot::SetFilled方法代码示例

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


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

示例1: _renderPlotLine

 private function _renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d')
 {
     $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
     $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
     if ($labelCount > 0) {
         $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
         $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount);
         $this->_graph->xaxis->SetTickLabels($datasetLabels);
     }
     $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
     $seriesPlots = array();
     if ($grouping == 'percentStacked') {
         $sumValues = $this->_percentageSumCalculation($groupID, $seriesCount);
     }
     //	Loop through each data series in turn
     for ($i = 0; $i < $seriesCount; ++$i) {
         $dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
         $marker = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
         if ($grouping == 'percentStacked') {
             $dataValues = $this->_percentageAdjustValues($dataValues, $sumValues);
         }
         //	Fill in any missing values in the $dataValues array
         $testCurrentIndex = 0;
         foreach ($dataValues as $k => $dataValue) {
             while ($k != $testCurrentIndex) {
                 $dataValues[$testCurrentIndex] = null;
                 ++$testCurrentIndex;
             }
             ++$testCurrentIndex;
         }
         $seriesPlot = new LinePlot($dataValues);
         if ($combination) {
             $seriesPlot->SetBarCenter();
         }
         if ($filled) {
             $seriesPlot->SetFilled(true);
             $seriesPlot->SetColor('black');
             $seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour++]);
         } else {
             //	Set the appropriate plot marker
             $this->_formatPointMarker($seriesPlot, $marker);
         }
         $dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
         $seriesPlot->SetLegend($dataLabel);
         $seriesPlots[] = $seriesPlot;
     }
     if ($grouping == 'standard') {
         $groupPlot = $seriesPlots;
     } else {
         $groupPlot = new AccLinePlot($seriesPlots);
     }
     $this->_graph->Add($groupPlot);
 }
开发者ID:s-kalaus,项目名称:ekernel,代码行数:53,代码来源:jpgraph.php

示例2: CourbeParHeure

function CourbeParHeure($zoom = false)
{
    $day = $_GET["DAY"];
    if ($day == null) {
        $day = date('Y-m-d');
    }
    @mkdir($_GET["BASEPATH"], 0755, true);
    $f_name = "day-global-{$day}.png";
    if ($zoom) {
        $f_name = "day-global-{$day}-zoom.png";
    }
    $fileName = "{$_GET["BASEPATH"]}/{$f_name}";
    if (is_file($fileName)) {
        if (file_get_time_min($fileName) < 20) {
            return "{$_GET["IMGPATH"]}/{$f_name}";
        }
    }
    @unlink($fileName);
    $q = new mysql();
    $sql = "SELECT COUNT(ID) as tcount ,DATE_FORMAT(zDate,'%h') as thour \nFROM `mbx_con`  WHERE DATE_FORMAT(zDate,'%Y-%m-%d')='{$day}' GROUP BY thour ORDER BY thour";
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ydata[] = $ligne["tcount"];
        $xdata[] = $ligne["thour"];
    }
    if (count($ydata) < 2) {
        $ydata[] = 1;
        $xdata[] = date('d');
    }
    $width = 500;
    $height = 200;
    if ($zoom) {
        $width = 720;
        $height = 400;
    }
    $graph = new Graph($width, $height);
    $graph->SetScale('textlin');
    $graph->title->Set("Connexions numbers {$day}");
    $graph->title->SetColor('white');
    $graph->xaxis->title->Set('hours');
    $graph->xaxis->SetTickLabels($xdata);
    $graph->yaxis->title->Set('(connexions)');
    $graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN);
    $graph->SetPlotGradient('black', 'darkred:0.8', 2);
    $graph->xaxis->SetColor('lightgray');
    $graph->yaxis->SetColor('lightgray');
    $graph->xgrid->Show();
    $lineplot = new LinePlot($ydata);
    $lineplot->SetWeight(2);
    $lineplot->SetColor('orange:0.9');
    $lineplot->SetFillColor('white@0.7');
    $lineplot->SetFillFromYMin();
    $lineplot->SetWeight(2);
    $lineplot->SetFilled(true);
    $lineplot->SetFillFromYMin(true);
    $graph->Add($lineplot);
    $gdImgHandler = $graph->Stroke(_IMG_HANDLER);
    $graph->img->Stream($fileName);
    return "{$_GET["IMGPATH"]}/{$f_name}";
}
开发者ID:brucewu16899,项目名称:artica,代码行数:60,代码来源:imap.daily.statistics.php

示例3: courbeparmois

function courbeparmois($zoom = false)
{
    $month = $_GET["MONTH"];
    @mkdir($_GET["BASEPATH"], 0755, true);
    $f_name = "day-global-{$month}.png";
    if ($zoom) {
        $f_name = "day-global-{$month}-zoom.png";
    }
    $fileName = "{$_GET["BASEPATH"]}/{$f_name}";
    if (is_file($fileName)) {
        if (file_get_time_min($fileName) < 120) {
            return "{$_GET["IMGPATH"]}/{$f_name}";
        }
    }
    @unlink($fileName);
    $q = new mysql();
    $sql = "SELECT SUM(emails) as tcount , DATE_FORMAT(DAY,'%d') as tday FROM `smtp_logs_day`  WHERE DATE_FORMAT(DAY,'%Y-%m')='{$_GET["MONTH"]}' GROUP BY tday ORDER BY tday";
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ydata[] = $ligne["tcount"];
        $xdata[] = $ligne["DAY"];
    }
    if (count($ydata) < 2) {
        $ydata[] = 1;
        $xdata[] = date('d');
    }
    $width = 500;
    $height = 200;
    if ($zoom) {
        $width = 720;
        $height = 400;
    }
    $graph = new Graph($width, $height);
    $graph->SetScale('textlin');
    $graph->title->Set("Received Mails {$_GET["MONTH"]}");
    $graph->title->SetColor('white');
    $graph->xaxis->title->Set('days');
    $graph->xaxis->SetTickLabels($xdata);
    $graph->yaxis->title->Set('(emails number)');
    $graph->yaxis->scale->SetGrace(10);
    $graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN);
    $graph->SetPlotGradient('black', 'darkred:0.8', 2);
    $graph->SetMargin(55, 20, 60, 20);
    //$graph->img->SetMargin(50,30,30,100);
    $graph->xaxis->SetColor('lightgray');
    $graph->yaxis->SetColor('lightgray');
    $graph->xgrid->Show();
    $lineplot = new LinePlot($ydata);
    $lineplot->SetWeight(2);
    $lineplot->SetColor('orange:0.9');
    $lineplot->SetFillColor('white@0.7');
    $lineplot->SetFillFromYMin();
    $lineplot->SetWeight(2);
    $lineplot->SetFilled(true);
    $lineplot->SetFillFromYMin(true);
    $graph->Add($lineplot);
    $gdImgHandler = $graph->Stroke(_IMG_HANDLER);
    $graph->img->Stream($fileName);
    return "{$_GET["IMGPATH"]}/{$f_name}";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:60,代码来源:smtp.daily.statistics.php

示例4: courbe_today

function courbe_today($domain)
{
    $tpl = new templates();
    $q = new mysql();
    $dansguardian_events = "dansguardian_events_" . date('Ym');
    $sql = "SELECT COUNT( ID ) AS tcount, sitename, DATE_FORMAT( zdate, '%H' ) AS thour , DATE_FORMAT( zdate, '%Y-%m-%d' ) AS tday\nFROM {$dansguardian_events}\nWHERE sitename = '{$domain}'\nGROUP BY thour , tday\nHAVING tday = DATE_FORMAT( NOW( ) , '%Y-%m-%d' )\nORDER BY thour";
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $GLOBALS["stats-array-{$domain}"][] = "<tr>\n\t<td style='font-size:12px;font-weight:bold' nowrap>{$ligne["thour"]}:00</td>\n\t<td style='font-size:12px;font-weight:bold' nowrap>{$ligne["tcount"]} hits</td>\n\t</tr>\n\t";
        $ydata[] = $ligne["tcount"];
        $xdata[] = $ligne["hour"];
    }
    $f_name = "day-squid-{$domain}.png";
    $fileName = "ressources/logs/{$f_name}";
    if (is_file($fileName)) {
        if (file_get_time_min($fileName) < 120) {
            return $fileName;
        }
    }
    $title = "{$domain} " . $tpl->_ENGINE_parse_body('{today}');
    @unlink($fileName);
    $width = 500;
    $height = 200;
    if ($zoom) {
        $width = 720;
        $height = 400;
    }
    JpGraphError::SetImageFlag(false);
    $graph = new Graph($width, $height);
    $graph->SetScale('textlin');
    $graph->title->Set($title);
    $graph->title->SetColor('white');
    $graph->xaxis->title->Set('hours');
    $graph->xaxis->SetTickLabels($xdata);
    $graph->yaxis->title->Set('(hits number)');
    $graph->yaxis->scale->SetGrace(10);
    $graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN);
    $graph->SetPlotGradient('black', 'darkred:0.8', 2);
    $graph->SetMargin(55, 20, 60, 20);
    //$graph->img->SetMargin(50,30,30,100);
    $graph->xaxis->SetColor('lightgray');
    $graph->yaxis->SetColor('lightgray');
    $graph->xgrid->Show();
    $lineplot = new LinePlot($ydata);
    $lineplot->SetWeight(2);
    $lineplot->SetColor('orange:0.9');
    $lineplot->SetFillColor('white@0.7');
    $lineplot->SetFillFromYMin();
    $lineplot->SetWeight(2);
    $lineplot->SetFilled(true);
    $lineplot->SetFillFromYMin(true);
    $graph->Add($lineplot);
    JpGraphError::SetImageFlag(false);
    try {
        $gdImgHandler = $graph->Stroke(_IMG_HANDLER);
    } catch (JpGraphException $e) {
        // .. do necessary cleanup
        // Send back error message
        // $e->Stroke();
    }
    $graph->img->Stream($fileName);
    return $fileName;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:63,代码来源:squid.website.stats.php

示例5: courbe_month

function courbe_month()
{
    $tpl = new templates();
    $q = new mysql();
    $sql = "SELECT COUNT(ID) as tcount, DATE_FORMAT(zDate,'%d') as tday FROM fetchmail_events WHERE MONTH(zDate)=MONTH(NOW()) \nAND YEAR (zDate)=YEAR(NOW()) GROUP BY tday ORDER BY tday;";
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ydata[] = $ligne["tcount"];
        $xdata[] = $ligne["tday"];
    }
    $f_name = "month-fetchmail.png";
    $fileName = "ressources/logs/{$f_name}";
    /*	if(is_file($fileName)){
    		if(file_get_time_min($fileName)<120){return $fileName;}
    	}*/
    @unlink($fileName);
    $title = "{$domain} " . $tpl->_ENGINE_parse_body('{this_month}');
    $YNAME = $tpl->_ENGINE_parse_body("{emails_number}");
    $XNAME = $tpl->_ENGINE_parse_body("{days}");
    $width = 500;
    $height = 200;
    $graph = new Graph($width, $height);
    try {
        $graph->img->SetColor("red@0.9");
        $graph->SetMarginColor('#FFFFFF');
        $graph->SetScale('textlin');
        $graph->title->Set($title);
        $graph->title->SetColor('#005447');
        $graph->xaxis->title->Set($XNAME);
        $graph->xaxis->SetTickLabels($xdata);
        $graph->yaxis->title->Set($YNAME);
        $graph->yaxis->scale->SetGrace(10);
        //$graph->SetBackgroundGradient('darkred:0.7', 'black', 2, BGRAD_MARGIN);
        //$graph->SetPlotGradient('black','darkred:0.8', 2);
        $graph->SetMargin(55, 20, 60, 20);
        $graph->xaxis->SetColor('black');
        $graph->yaxis->SetColor('black');
        $graph->xgrid->Show();
        $lineplot = new LinePlot($ydata);
        $lineplot->SetWeight(2);
        $lineplot->SetColor('#005447');
        $lineplot->SetFillColor('green@0.5');
        //$lineplot->SetFillColor('white@0.9');
        $lineplot->SetFillFromYMin();
        $lineplot->SetWeight(3);
        $lineplot->SetFilled(true);
        $lineplot->SetFillFromYMin(true);
        $graph->Add($lineplot);
        JpGraphError::SetImageFlag(false);
        $gdImgHandler = $graph->Stroke(_IMG_HANDLER);
    } catch (JpGraphException $e) {
        // .. do necessary cleanup
        // Send back error message
        // $e->Stroke();
    }
    $graph->img->Stream($fileName);
    return $fileName;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:58,代码来源:fetchmail.events.php


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