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


PHP Graph::SetBackgroundImage方法代码示例

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


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

示例1: drawGraph

 public function drawGraph()
 {
     // generate graphic
     $graph = new Graph($this->width, $this->height, "auto");
     $graph->SetScale("textlin");
     $graph->img->SetMargin(0, 0, 1, 0);
     //$graph->SetFrame(true);
     // generate bars
     $bplot = new BarPlot($this->data);
     $graph->Add($bplot);
     // format bars
     $bplot->SetFillColor('gray');
     //show background image if file exists
     if (false === empty($this->bgImg) && file_exists($this->bgImg)) {
         $graph->SetBackgroundImage($this->bgImg, BGIMG_FILLFRAME);
     }
     $bplot->SetFillGradient("gray", "darkgray", GRAD_HOR);
     $graph->yaxis->HideTicks(true, true);
     $graph->xaxis->HideLabels(true);
     // show graphic
     $graph->Stroke();
 }
开发者ID:alexukua,项目名称:opus4,代码行数:22,代码来源:StatisticGraphThumb.php

示例2: array

<?php

// content="text/plain; charset=utf-8"
require_once '../jpgraph.php';
require_once '../jpgraph_line.php';
// Some data
$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);
$graph->SetScale("textlin");
$graph->SetMargin(40, 40, 50, 50);
// Setup the grid and plotarea box
$graph->ygrid->SetLineStyle('dashed');
$graph->ygrid->setColor('darkgray');
$graph->SetBox(true);
// Steup graph titles
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 12);
$graph->title->Set('Using background image');
$graph->subtitle->SetFont(FF_COURIER, FS_BOLD, 11);
$graph->subtitle->Set('"BGIMG_COPY"');
$graph->subtitle->SetColor('darkred');
// Add background with 25% mix
$graph->SetBackgroundImage('heat1.jpg', BGIMG_COPY);
$graph->SetBackgroundImageMix(25);
// Create the linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetColor("blue");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
开发者ID:albatronic,项目名称:hermes,代码行数:31,代码来源:background_type_ex0.php

示例3: fopen

    $fp = fopen($name, 'rb');
    // send the right headers
    header("Content-Type: image/png");
    header("Content-Length: " . filesize($name));
    // dump the picture and stop the script
    fpassthru($fp);
    exit;
}
$temperature_plot = new LinePlot($temperature, $ts);
$temperature_plot->SetColor('hotpink3');
$temperature_plot->SetWeight(2);
$temperature_plot->SetFillColor($line_fill_color);
$graph = new Graph($width, $height);
$graph->SetFrame(false);
if ($zoom_level == 0) {
    $graph->SetBackgroundImage('background_h_30_36.png', BGIMG_FILLPLOT);
} else {
    $graph->SetBackgroundImage('background_h_28_32.png', BGIMG_FILLPLOT);
}
$graph->SetBackgroundImageMix(35);
$graph->SetMargin(60, 60, 40, 50);
$graph->SetMarginColor('white');
$graph->SetScale('datlin', $TEMPERATURE_MIN[$zoom_level], $TEMPERATURE_MAX[$zoom_level]);
$graph->Add($temperature_plot);
$graph->ygrid->SetColor("azure3");
$graph->ygrid->Show(true, true);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->scale->SetDateFormat('g a');
$graph->xaxis->SetWeight(2);
$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, $font_size - 3);
$graph->yaxis->SetWeight(2);
开发者ID:Rockvole,项目名称:indoor-air-quality-dashboard,代码行数:31,代码来源:temperature.php

示例4: array

<?php

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_line.php';
// Some data
$datay = array(28, 19, 18, 23, 12, 11);
$data2y = array(14, 18, 33, 29, 39, 55);
// A nice graph with anti-aliasing
$graph = new Graph(400, 200);
$graph->img->SetMargin(40, 180, 40, 40);
$graph->SetBackgroundImage("tiger_bkg.png", BGIMG_FILLPLOT);
$graph->img->SetAntiAliasing("white");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->Set("Background image");
// Use built in font
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Slightly adjust the legend from it's default position in the
// top right corner.
$graph->legend->Pos(0.05, 0.5, "right", "center");
// Create the first line
$p1 = new LinePlot($datay);
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend("Triumph Tiger -98");
$graph->Add($p1);
// ... and the second
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:backgroundex01.php

示例5: array

    }
}
// Data arrays
$datax = array(10, 20, 30, 40, 54, 60, 70, 80);
$datay = array(12, 23, 65, 18, 84, 28, 86, 44);
// Setup the graph
$graph = new Graph(400, 270);
// We add a small 1pixel left,right,bottom margin so the plot area
// doesn't cover the frame around the graph.
$graph->img->SetMargin(1, 1, 1, 1);
$graph->SetScale('linlin', 0, 100, 0, 100);
// We don't want any axis to be shown
$graph->xaxis->Hide();
$graph->yaxis->Hide();
// Use a worldmap as the background and let it fill the plot area
$graph->SetBackgroundImage(WORLDMAP, BGIMG_FILLPLOT);
// Setup a nice title with a striped bevel background
$graph->title->Set("Pushpin graph");
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 16);
$graph->title->SetColor('white');
$graph->SetTitleBackground('darkgreen', TITLEBKG_STYLE1, TITLEBKG_FRAME_BEVEL);
$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED, 'blue', 'darkgreen');
// Finally create the scatterplot
$sp = new ScatterPlot($datay, $datax);
// We want the markers to be an image
$sp->mark->SetType(MARK_IMG_PUSHPIN, 'blue', 0.6);
// Install the Y-X callback for the markers
$sp->mark->SetCallbackYX('markCallback');
// ...  and add it to the graph
$graph->Add($sp);
// .. and output to browser
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:pushpinex1.php

示例6: array

$datay1 = array(140, 110, 50, 60);
$datay2 = array(35, 90, 190, 190);
$datay3 = array(20, 60, 70, 140);
// Create the basic graph
$graph = new Graph(450, 250, 'auto');
$graph->SetScale("textlin");
$graph->img->SetMargin(40, 80, 30, 40);
// Adjust the position of the legend box
$graph->legend->Pos(0.02, 0.15);
// Adjust the color for theshadow of the legend
$graph->legend->SetShadow('darkgray@0.5');
$graph->legend->SetFillColor('lightblue@0.3');
// Get localised version of the month names
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Set a nice summer (in Stockholm) image
$graph->SetBackgroundImage('stship.jpg', BGIMG_COPY);
// Set axis titles and fonts
$graph->xaxis->title->Set('Year 2002');
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetColor('white');
$graph->xaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetColor('white');
$graph->yaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->SetColor('white');
//$graph->ygrid->Show(false);
$graph->ygrid->SetColor('white@0.5');
// Setup graph title
$graph->title->Set('Using alpha blending with a background');
// Some extra margin (from the top)
$graph->title->SetMargin(3);
$graph->title->SetFont(FF_COMIC, FS_NORMAL, 12);
开发者ID:tavo1981,项目名称:phpbar,代码行数:31,代码来源:alphabarex1.php

示例7: floor

}
foreach ($humidity as $value) {
    $bucket_pos = floor($value / $range_interval);
    if ($bucket_pos >= $INTERVAL_COUNT) {
        $bucket_pos = $INTERVAL_COUNT - 1;
    }
    $bucket[$bucket_pos]++;
    //error_log("item=".$value."||bucket_pos=".$bucket_pos."||count=".$bucket[$bucket_pos]);
}
$humidity_plot = new BarPlot($bucket);
$humidity_plot->SetColor('dodgerblue');
$humidity_plot->SetWeight(2);
$humidity_plot->SetFillColor('dodgerblue');
$graph = new Graph($width, $height);
$graph->SetFrame(false);
$graph->SetBackgroundImage('background_v_40_60.png', BGIMG_FILLPLOT);
$graph->SetBackgroundImageMix(35);
$graph->SetMargin(60, 60, 40, 50);
$graph->SetMarginColor('white');
$graph->SetScale('textlin');
$graph->Add($humidity_plot);
$graph->ygrid->SetColor("azure3");
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetWeight(2);
$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, $font_size - 3);
$graph->xaxis->SetTickLabels($tick_labels);
$graph->yaxis->SetWeight(2);
$graph->yaxis->SetColor('dodgerblue');
$graph->yaxis->SetFont(FF_ARIAL, FS_NORMAL, $font_size - 3);
$graph->yaxis->title->SetColor('dodgerblue');
$graph->yaxis->title->Set('Number of occurrences');
开发者ID:Rockvole,项目名称:indoor-air-quality-dashboard,代码行数:31,代码来源:hist_dht22.php

示例8: createBubbleGraph

 private function createBubbleGraph($datax, $datay, $dataz, $datalabel, $title)
 {
     global $format;
     // Create the graph.
     // We need to create X,Y data vectors suitable for the
     // library from the above raw data.
     $n = count($datax);
     for ($i = 0; $i < $n; ++$i) {
         // Create a faster lookup array so we don't have to search
         // for the correct values in the callback function
         $format[strval($datax[$i])][strval($datay[$i])] = array($datalabel[$i], $dataz[$i]);
     }
     // Callback for markers
     // Must return array(width,border_color,fill_color,filename,imgscale)
     // If any of the returned values are '' then the
     // default value for that parameter will be used (possible empty)
     function FCallback($aYVal, $aXVal)
     {
         global $format;
         return array($format[strval($aXVal)][strval($aYVal)][0], '', $format[strval($aXVal)][strval($aYVal)][1], '', '');
     }
     $graph = new Graph($this->width, $this->height, "auto");
     // Set the background image
     $graph->SetBackgroundImage('protected/lib/jpgraph/gfx/riscmap.jpg', BGIMG_COPY);
     $graph->SetScale("linlin");
     $graph->img->SetMargin(60, 60, 60, 60);
     $graph->title->Set($title);
     $graph->title->SetFont(FF_FONT1, FS_BOLD);
     if ($this->shadow) {
         $graph->SetShadow();
     }
     // Use a lot of grace to get large scales since the ballon have
     // size and we don't want them to collide with the X-axis
     $graph->yaxis->scale->SetGrace(50, 10);
     $graph->yaxis->title->Set($this->ylabel[0]);
     $graph->xaxis->scale->SetGrace(50, 10);
     $graph->xaxis->title->Set($this->xlabel[0]);
     // Make sure X-axis as at the bottom of the graph and not at the default Y=0
     $graph->xaxis->SetPos('min');
     // Set X-scale to start at 0
     $graph->xscale->SetAutoMin('min');
     // Create the scatter plot
     $sp1 = new ScatterPlot($datay, $datax);
     $sp1->mark->SetType(MARK_FILLEDCIRCLE);
     // Uncomment the following two lines to display the values
     $sp1->value->Show();
     $sp1->value->SetFont(FF_FONT1, FS_BOLD);
     // Callback for markers
     $sp1->mark->SetCallbackYX("FCallback");
     // Add the scatter plot to the graph
     $graph->Add($sp1);
     return $graph;
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:53,代码来源:BubbleService.php

示例9: 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

示例10: Graph

$graph = new Graph(350,250);
$graph->SetScale("textlin");
$graph->SetMargin(40,40,50,50);

// Setup the grid and plotarea box
$graph->ygrid->SetLineStyle('dashed');
$graph->ygrid->setColor('darkgray');
$graph->SetBox(true);

// Steup graph titles
//$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->title->Set('Using background image');
$graph->subtitle->SetFont(FF_COURIER,FS_BOLD,11);
$graph->subtitle->Set('"BGIMG_CENTER"');
$graph->subtitle->SetColor('darkred');

// Add background with 25% mix
$graph->SetBackgroundImage('heat1.jpg',BGIMG_CENTER);
$graph->SetBackgroundImageMix(25);

// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetColor("blue");

// Add the plot to the graph
$graph->Add($lineplot);

// Display the graph
$graph->Stroke();
?>
开发者ID:rcroxyosox,项目名称:jobtracker,代码行数:30,代码来源:background_type_ex1.php

示例11: gmdate

    $ts_str = gmdate('r', $row['ts']);
    error_log("temp=" . $row['temperature'] . "||humidity=" . $row['humidity'] . "||ts=" . $row['ts'] . "||ts=" . $ts_str);
    $ts[] = $row['ts'];
    $temperature[] = $row['temperature'];
    $humidity[] = $row['humidity'];
}
$humidity_plot = new LinePlot($humidity, $ts);
$humidity_plot->SetColor('dodgerblue');
$humidity_plot->SetWeight(2);
$humidity_plot->SetFillColor($line_fill_color);
$temperature_plot = new LinePlot($temperature, $ts);
$temperature_plot->SetColor('hotpink3');
$temperature_plot->SetWeight(2);
$graph = new Graph($width, $height);
$graph->SetFrame(false);
$graph->SetBackgroundImage('traffic40_60.png', BGIMG_FILLPLOT);
$graph->SetBackgroundImageMix(35);
$graph->SetMargin(60, 60, 40, 50);
$graph->SetMarginColor('white');
$graph->SetScale('datlin', 0, 100);
$graph->Add($humidity_plot);
$graph->SetY2Scale('lin', 5, 30);
$graph->AddY2($temperature_plot);
$graph->ygrid->SetColor("azure3");
$graph->ygrid->Show(true, true);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->scale->SetDateFormat('g a');
$graph->xaxis->SetWeight(2);
$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, $font_size - 3);
$graph->yaxis->SetWeight(2);
$graph->yaxis->SetColor('dodgerblue');
开发者ID:dankot,项目名称:temperature-humidity-dashboard,代码行数:31,代码来源:dht22.php

示例12: array

<?php

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_line.php';
// Some data
$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);
$graph->SetScale("textlin");
$graph->SetMargin(40, 40, 50, 50);
// Setup the grid and plotarea box
$graph->ygrid->SetLineStyle('dashed');
$graph->ygrid->setColor('darkgray');
$graph->SetBox(true);
// Steup graph titles
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 12);
$graph->title->Set('Using background image');
$graph->subtitle->SetFont(FF_COURIER, FS_BOLD, 11);
$graph->subtitle->Set('"BGIMG_FREE"');
$graph->subtitle->SetColor('darkred');
// Add background with 25% mix
$graph->SetBackgroundImage('heat1.jpg', BGIMG_FREE);
$graph->SetBackgroundImageMix(25);
// Create the linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetColor("blue");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:31,代码来源:background_type_ex2.php

示例13: tr

//
$stat = tr('oc_stat');
$graph->title->SetFont(FF_GEORGIA, FS_NORMAL, 14);
$graph->title->Set($stat);
$graph->title->SetMargin(12);
$graph->footer->center->Set(tr('graph_statistics_01') . date('d:m:Y H:i:s'));
$graph->footer->center->SetFont(FF_ARIAL, FS_NORMAL, 7);
$graph->footer->center->SetColor('darkgray');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.5, 0.96, "center", "bottom");
$graph->legend->SetLineWeight(8);
$graph->img->SetMargin(45, 60, 50, 70);
$graph->SetFrame(false);
$graph->SetColor(array(245, 245, 245));
$graph->SetMarginColor(array(238, 238, 238));
$graph->SetBackgroundImage('images/statbg-oc.jpg', BGIMG_CENTER, 'auto');
//
// Skalierung, X- und Y-Achse formatieren
//
$graph->SetScale("intlin", 0, 0, $startDate, time());
$graph->SetY2Scale("lin");
$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 7);
$graph->xaxis->SetMajTickPositions($tickPositions, $tickLabels);
$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");
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:new-caches-oc.php

示例14: generateStackedBarGraph

 function generateStackedBarGraph($data, $legend_index = 0, $image = false, $aFillColors = array('red', 'green', 'orange', 'yellow', 'aqua', 'lime', 'teal', 'purple1', 'lightblue', 'blue'), $length = 500, $width = 300, $fontFamily = FF_FONT1, $fontStyle = FS_BOLD, $fontSize = '', $fontColor = 'black', $marginColor = 'white')
 {
     include_once XHELP_JPGRAPH_PATH . '/jpgraph_bar.php';
     $graph = new Graph($length, $width);
     $graph->title->Set($this->meta['name']);
     $graph->SetScale("textint");
     $graph->yaxis->scale->SetGrace(30);
     //$graph->ygrid->Show(true,true);
     $graph->ygrid->SetColor('gray', 'lightgray@0.5');
     // Setup graph colors
     $graph->SetMarginColor($marginColor);
     $datazero = array(0, 0, 0, 0);
     // Create the "dummy" 0 bplot
     $bplotzero = new BarPlot($datazero);
     // Set names as x-axis label
     $graph->xaxis->SetTickLabels($data[$legend_index]);
     // for loop through data array starting with element 1
     $aPlots = array();
     for ($i = 1; $i < count($data); $i++) {
         $ybplot1 = new BarPlot($data[$i]);
         $ybplot1->setFillColor($aFillColors[$i]);
         $ybplot1->value->Show();
         $ybplot1->value->SetFont($fontFamily, $fontStyle, $fontSize);
         $ybplot1->value->SetColor($fontColor);
         $aPlots[] = $ybplot1;
     }
     //$ybplot = new AccBarPlot(array($ybplot1,$bplotzero));
     $ybplot = new AccBarPlot($aPlots, $bplotzero);
     $graph->Add($ybplot);
     // Set graph background image
     $graph->SetBackgroundImage($image, BGIMG_FILLFRAME);
     $graph->Stroke();
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:33,代码来源:report.php

示例15: header

    header("Content-Length: " . filesize($name));
    // dump the picture and stop the script
    fpassthru($fp);
    exit;
}
$humidity_plot = new LinePlot($humidity, $ts);
$humidity_plot->SetColor('dodgerblue');
$humidity_plot->SetWeight(2);
$humidity_plot->SetFillColor($line_fill_color);
$temperature_plot = new LinePlot($temperature, $ts);
$temperature_plot->SetColor('hotpink3');
$temperature_plot->SetWeight(2);
$graph = new Graph($width, $height);
$graph->SetFrame(false);
if ($zoom_level == 0) {
    $graph->SetBackgroundImage('background_h_25_75.png', BGIMG_FILLPLOT);
} else {
    $graph->SetBackgroundImage('background_h_40_60.png', BGIMG_FILLPLOT);
}
$graph->SetBackgroundImageMix(35);
$graph->SetMargin(60, 60, 40, 50);
$graph->SetMarginColor('white');
$graph->SetScale('datlin', $HUMIDITY_MIN[$zoom_level], $HUMIDITY_MAX[$zoom_level]);
$graph->Add($humidity_plot);
$graph->SetY2Scale('lin', $TEMPERATURE_MIN[$zoom_level], $TEMPERATURE_MAX[$zoom_level]);
$graph->AddY2($temperature_plot);
$graph->ygrid->SetColor("azure3");
$graph->ygrid->Show(true, true);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->scale->SetDateFormat('g a');
$graph->xaxis->SetWeight(2);
开发者ID:Rockvole,项目名称:indoor-air-quality-dashboard,代码行数:31,代码来源:dht22.php


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