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


PHP LinePlot::SetCenter方法代码示例

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


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

示例1: AudiogrammeTonal

 function AudiogrammeTonal($with_legend = true)
 {
     $frequences = CExamAudio::$frequences;
     $delta = $with_legend ? 75 : 0;
     // Setup the graph.
     $this->Graph(300 + $delta, 250, "auto");
     $this->SetScale("textlin", -120, 10);
     $this->SetMarginColor("lightblue");
     // Image setup
     //$this->img->SetAntiAliasing();
     $this->img->SetMargin(45, 20 + $delta, 30, 15);
     // Legend setup
     if ($with_legend) {
         $this->legend->Pos(0.02, 0.5, "right", "center");
         $this->legend->SetShadow("darkgray@0.5", 3);
         $this->legend->SetFont(FF_ARIAL, FS_NORMAL, 7);
         $this->legend->SetFillColor('white@0.3');
     } else {
         $this->legend->Hide();
     }
     // Title setup
     $this->title->SetFont(FF_ARIAL, FS_NORMAL, 10);
     $this->title->SetColor("darkred");
     //Setup X-axis labels
     $this->xgrid->Show(true);
     $this->xgrid->SetColor("lightgray", "lightgray:1.8");
     $this->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
     $this->xaxis->SetTickLabels($frequences);
     $this->xaxis->SetLabelSide(1);
     $this->xaxis->SetLabelMargin(22);
     // Setup Y-axis labels
     $this->ygrid->Show(true, true);
     $this->ygrid->SetColor("lightgray", "lightgray:1.8");
     $this->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
     $this->yaxis->SetLabelFormatString("%ddB");
     $this->yaxis->scale->ticks->Set(20, 10);
     $this->yaxis->scale->ticks->SupressZeroLabel(false);
     $this->yaxis->scale->ticks->SupressMinorTickMarks(false);
     // Empty plots for scale window
     foreach ($frequences as $value) {
         $datay[] = 100;
     }
     $p1 = new LinePlot($datay);
     $p1->SetCenter();
     $this->Add($p1);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:46,代码来源:inc_graph_audio_tonal.php

示例2: draw_graph

function draw_graph($datay, $data2y, $label_x)
{
    include_once "src/jpgraph.php";
    include_once "src/jpgraph_line.php";
    // A nice graph with anti-aliasing
    $graph = new Graph(800, 600, "auto");
    $graph->img->SetMargin(40, 180, 40, 40);
    $graph->img->SetAntiAliasing("white");
    $graph->SetScale("textlin");
    $graph->SetShadow();
    $graph->title->Set("Nodes and Comment Count By Duration");
    $graph->xaxis->SetTickLabels($label_x);
    // 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
    if ($datay) {
        $p1 = new LinePlot($datay);
        $p1->mark->SetType(MARK_FILLEDCIRCLE);
        $p1->mark->SetFillColor("blue");
        $p1->mark->SetWidth(4);
        $p1->SetColor("blue");
        $p1->SetCenter();
        $p1->SetLegend("Nodes Count");
        $graph->Add($p1);
    }
    // ... and the second
    if ($data2y) {
        $p2 = new LinePlot($data2y);
        $p2->mark->SetType(MARK_STAR);
        $p2->mark->SetFillColor("red");
        $p2->mark->SetWidth(4);
        $p2->SetColor("red");
        $p2->SetCenter();
        $p2->SetLegend("Comments Count");
        $graph->Add($p2);
    }
    // Output line
    $graph->Stroke();
}
开发者ID:ztobs,项目名称:wsf,代码行数:42,代码来源:image.php

示例3: LinePlot

//$Threads_running[] = $rs_a[$i]['Threads_running'];
//Threads_cached
$p1 = new LinePlot($Threads_cached);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend("Cached AVG:{$Threads_cached_avg}");
$graph->Add($p1);
//Threads_connected
$p2 = new LinePlot($Threads_connected);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend("Connected AVG:{$Threads_connected_avg}");
$graph->Add($p2);
//Threads_connected
//$p3 = new LinePlot($Threads_created);
//$p3->SetColor("orange");
//$p3->SetCenter();
//$p3->SetLegend("Threads_created AVG:$Threads_created_avg");
//$graph->Add($p3);
//Threads_connected
$p4 = new LinePlot($Threads_running);
$p4->SetColor("green");
$p4->SetCenter();
$p4->SetLegend("Running AVG:{$Threads_running_avg}");
$graph->Add($p4);
// Output line
$graph->Stroke();
?>


开发者ID:shesai0519,项目名称:sunshineCRM,代码行数:28,代码来源:system_logall_mysqlthreads.php

示例4: Graph

// Create the graph and set a scale.
// These two calls are always required
$graph = new Graph($width, $height);
$graph->SetScale('linlin', 0, 0, 0, 11);
$graph->SetMarginColor('white');
$graph->SetFrame(false);
// Setup margin and titles
$graph->SetMargin(40, 10, 10, 20);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTickLabels($xdata);
#$graph->yaxis->SetColor('red');
// Create the linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetColor('red');
$lineplot->SetCenter();
$lineplot->SetWeight(2);
// Two pixel wide
$lineplot->mark->SetType(MARK_FILLEDCIRCLE);
$lineplot->mark->SetWidth(3);
$lineplot->mark->SetColor('red');
$lineplot->mark->SetFillColor('red');
$lineplot->value->format = "%.1f";
$lineplot->value->SetFont(FF_ARIAL, FS_NORMAL, 7);
$lineplot->value->Show();
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
#$graph->Stroke();
$graph->Stroke('../../upload/ipo.png');
#var_dump($ydata);
开发者ID:sauger,项目名称:forbes,代码行数:31,代码来源:generate_ipo_image.php

示例5: graph_cumulative_bydate

function graph_cumulative_bydate($p_metrics, $p_graph_width = 300, $p_graph_height = 380)
{
    $t_graph_font = graph_get_font();
    error_check(is_array($p_metrics) ? count($p_metrics) : 0, lang_get('cumulative') . ' ' . lang_get('by_date'));
    foreach ($p_metrics as $i => $vals) {
        if ($i > 0) {
            $plot_date[] = $i;
            $reported_plot[] = $p_metrics[$i][0];
            $resolved_plot[] = $p_metrics[$i][1];
            $still_open_plot[] = $p_metrics[$i][2];
        }
    }
    $graph = new Graph($p_graph_width, $p_graph_height);
    $graph->img->SetMargin(40, 40, 40, 170);
    if (ON == config_get_global('jpgraph_antialias')) {
        $graph->img->SetAntiAliasing();
    }
    $graph->SetScale('linlin');
    $graph->SetMarginColor('white');
    $graph->SetFrame(false);
    $graph->title->Set(lang_get('cumulative') . ' ' . lang_get('by_date'));
    $graph->title->SetFont($t_graph_font, FS_BOLD);
    $graph->legend->Pos(0.05, 0.9, 'right', 'bottom');
    $graph->legend->SetShadow(false);
    $graph->legend->SetFillColor('white');
    $graph->legend->SetLayout(LEGEND_HOR);
    $graph->legend->SetFont($t_graph_font);
    $graph->yaxis->scale->ticks->SetDirection(-1);
    $graph->yaxis->SetFont($t_graph_font);
    if (FF_FONT2 <= $t_graph_font) {
        $graph->xaxis->SetLabelAngle(60);
    } else {
        $graph->xaxis->SetLabelAngle(90);
        # can't rotate non truetype fonts
    }
    $graph->xaxis->SetLabelFormatCallback('graph_date_format');
    $graph->xaxis->SetFont($t_graph_font);
    $p1 = new LinePlot($reported_plot, $plot_date);
    $p1->SetColor('blue');
    $p1->SetCenter();
    $p1->SetLegend(lang_get('legend_reported'));
    $graph->Add($p1);
    $p3 = new LinePlot($still_open_plot, $plot_date);
    $p3->SetColor('red');
    $p3->SetCenter();
    $p3->SetLegend(lang_get('legend_still_open'));
    $graph->Add($p3);
    $p2 = new LinePlot($resolved_plot, $plot_date);
    $p2->SetColor('black');
    $p2->SetCenter();
    $p2->SetLegend(lang_get('legend_resolved'));
    $graph->Add($p2);
    if (helper_show_queries()) {
        $graph->subtitle->Set(db_count_queries() . ' queries (' . db_count_unique_queries() . ' unique) (' . db_time_queries() . 'sec)');
        $graph->subtitle->SetFont($t_graph_font, FS_NORMAL, 8);
    }
    $graph->Stroke();
}
开发者ID:jin255ff,项目名称:company_website,代码行数:58,代码来源:graph_api.php

示例6: LinePlot

$p1->mark->SetFillColor("blue");
$p1->mark->SetWidth(3);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend($legend1);
$graph->Add($p1);
// 海の交通手段
$legend2 = mb_convert_encoding("海", "UTF-8", "eucJP-win");
$p2 = new LinePlot($data2);
$p2->mark->SetType(MARK_SQUARE);
$p2->mark->SetFillColor("red");
$p2->mark->SetWidth(4);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend($legend2);
$graph->Add($p2);
// 空の交通手段
$legend3 = mb_convert_encoding("空", "UTF-8", "eucJP-win");
$p3 = new LinePlot($data3);
$p3->mark->SetType(MARK_DIAMOND);
$p3->mark->SetFillColor("orange");
$p3->mark->SetWidth(6);
$p3->SetColor("orange");
$p3->SetCenter();
$p3->SetLegend($legend3);
$graph->Add($p3);
// グラフの描画
$graph->Stroke();
?>

开发者ID:enyaku,项目名称:myGoogleMapsApiV3Test,代码行数:29,代码来源:linegraph.php

示例7: Graph

// conversion
$graphCon = new Graph(700, 175, 'auto');
$graphCon->img->SetMargin(40, 40, 40, 40);
$graphCon->SetMarginColor('gray9');
$graphCon->SetScale('textlin');
$graphCon->xaxis->SetTickLabels($tickLabels);
$graphCon->xaxis->SetFont(FF_FONT1);
$graphCon->img->SetAntiAliasing();
$graphCon->SetShadow();
$graphCon->title->Set($tickLabels[0] . '(' . $yearArray[0] . ') - ' . $tickLabels[11] . '(' . $yearArray[11] . ')');
$graphCon->SetColor('cornsilk');
$graphCon->yscale->SetGrace(10, 10);
foreach ($graphArray as $k => $v) {
    $pl = new LinePlot($v);
    $pl->mark->SetWidth(6);
    $pl->SetCenter();
    $pl->SetLegend($k);
    $pl->value->Show();
    $pl->value->SetFormat('%d');
    $pl->value->SetFont(FF_FONT0);
    switch ($k) {
        case 'personal':
            $marker = 'blue';
            $line = 'blue';
            $mark = MARK_UTRIANGLE;
            $pl->mark->SetType($mark);
            $pl->mark->SetFillColor($marker);
            $pl->SetColor($line);
            $graphPer->Add($pl);
            break;
        case 'professional':
开发者ID:jmathai,项目名称:photos,代码行数:31,代码来源:stats_home.dsp.php

示例8: LinePlot

$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
$p2 = new LinePlot($data2y);
$p2->mark->SetType(MARK_STAR);
$p2->mark->SetFillColor("red");
$p2->mark->SetWidth(4);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend("New tiger -99");
$graph->Add($p2);
// Output line
$graph->Stroke();
?>


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

示例9: LinePlot

$graph->tabtitle->Set(' Year 2003 ');
$graph->tabtitle->SetFont(FF_ARIAL, FS_BOLD, 13);
$graph->tabtitle->SetColor('darkred', '#E1E1FF');
// Enable X-grid as well
$graph->xgrid->Show();
// Use months as X-labels
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Create the plot
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
$p1->SetCSIMTargets(array('#1', '#2', '#3', '#4', '#5'));
// Use an image of favourite car as
$p1->mark->SetType(MARK_IMG, 'saab_95.jpg', 0.5);
//$p1->mark->SetType(MARK_SQUARE);
// Displayes value on top of marker image
$p1->value->SetFormat('%d mil');
$p1->value->Show();
$p1->value->SetColor('darkred');
$p1->value->SetFont(FF_ARIAL, FS_BOLD, 10);
// Increase the margin so that the value is printed avove tje
// img marker
$p1->value->SetMargin(14);
// Incent the X-scale so the first and last point doesn't
// fall on the edges
$p1->SetCenter();
$graph->Add($p1);
$graph->StrokeCSIM();
?>


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

示例10: addAudiogramme

 function addAudiogramme($values, $mark_color)
 {
     $pressions = CExamAudio::$pressions;
     // Empty plot case
     $datay = $values;
     CMbArray::removeValue("", $datay);
     if (!count($datay)) {
         return;
     }
     $title = $this->title->t;
     $words = explode(" ", $title);
     $cote = $words[1];
     $labels = array();
     $jscalls = array();
     // Remove empty values to connect distant points
     $datax = array();
     $datay = array();
     foreach ($values as $key => $value) {
         if ($value !== "" && $value !== null) {
             $pression = $pressions[$key];
             $jstitle = strtr($title, "\n", " ");
             $labels[] = "Modifier l'admittance {$value} ml pour {$jstitle} à la pression {$pression} mm H²0";
             $jscalls[] = "javascript:changeTympanValue('{$cote}',{$key})";
             $datay[] = $value;
             $datax[] = "{$key}";
             // Needs to be a string when null
         }
     }
     $p1 = new LinePlot($datay, $datax);
     // Create the first line
     $p1->SetColor($mark_color);
     $p1->SetCenter();
     $p1->SetWeight(1);
     $p1->SetCSIMTargets($jscalls, $labels);
     // Marks
     $p1->mark->SetType(MARK_FILLEDCIRCLE);
     $p1->mark->SetColor($mark_color);
     $p1->mark->SetFillColor("{$mark_color}@0.6");
     $p1->mark->SetWidth(4);
     $this->Add($p1);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:41,代码来源:inc_graph_audio_tympan.php

示例11: trim

$graph->img->SetMargin(50, 50, 50, 50);
$graph->SetShadow();
$graph->title->Set("Rencana Penarikan Anggaran Tahun " . $th);
$graph->subtitle->Set('Kegiatan : ' . trim(nm_giat($kdgiat)));
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 20);
$graph->subtitle->SetFont(FF_ARIAL, FS_BOLD, 12);
$graph->xaxis->title->SetFont(FF_ARIAL, FS_BOLD, 15);
$graph->yaxis->title->SetFont(FF_ARIAL, FS_BOLD, 15);
$graph->xaxis->SetTickLabels($leg);
$graph->legend->Pos(0.1, 0.09);
$graph->legend->SetFont(FF_ARIAL, FS_BOLD, 15);
$graph->xaxis->SetFont(FF_ARIAL, FS_BOLD, 15);
$graph->xaxis->title->Set("Bulan");
$graph->yaxis->SetFont(FF_ARIAL, FS_BOLD, 15);
$graph->legend->Pos(0.8, 0.13, "right", "center");
$bplot1 = new LinePlot($sbx_grafik_1);
$bplot1->mark->SetType(MARK_FILLEDCIRCLE);
$bplot1->mark->SetFillColor("red");
$bplot1->mark->SetWidth(8);
$bplot1->SetColor("blue");
$bplot1->SetWeight(3);
$bplot1->value->Show();
$bplot1->value->SetFont(FF_ARIAL, FS_BOLD, 15);
$bplot1->value->SetAngle(30);
$bplot1->SetCenter(0.4, 0.5);
$bplot1->SetLegend("Rencana Penarikan (%)");
$graph->Add($bplot1);
$graph->Stroke();
?>

开发者ID:abbeet,项目名称:server39,代码行数:29,代码来源:penarikan_giat_grafik.php

示例12: array

/* END OF POSTS GRAPH */
/* START OF TOPICS GRAPH */
$topics = $dates = array();
$result = $db->query('SELECT topics FROM ' . $db->prefix . 'stats ORDER BY date ASC') or error('Unable to fetch topic history', __FILE__, __LINE__, $db->error());
while ($temp = $db->fetch_row($result)) {
    $topics[] = $temp[0];
}
$result = $db->query('SELECT date FROM ' . $db->prefix . 'stats ORDER BY date ASC') or error('Unable to fetch date history', __FILE__, __LINE__, $db->error());
while ($temp = $db->fetch_row($result)) {
    $date[] = date('j M', $temp[0]);
}
// A nice graph with anti-aliasing
$graph = new Graph(600, 200, 'auto');
$graph->img->SetMargin(60, 20, 20, 60);
$graph->img->SetAntiAliasing('black');
$graph->SetScale('textlin');
$graph->title->Set('Topic Count');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTickLabels($date);
$graph->xaxis->SetLabelAngle(90);
$topic_plot = new LinePlot($topics);
$topic_plot->mark->SetType(MARK_STAR);
$topic_plot->mark->SetFillColor('black');
$topic_plot->mark->SetWidth(4);
$topic_plot->SetColor('red');
$topic_plot->SetCenter();
$graph->Add($topic_plot);
$graph->Stroke(PUN_ROOT . 'img/stats/topics.png');
/* END OF TOPICS GRAPH */
$db->close();
exit('Finished' . "\n");
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:31,代码来源:rscd_stats.php

示例13: LinePlot

    $bar1->SetColor('blue');
    $bar1->SetFillColor('blue');
    $bar1->SetLegend('Mail');
    $bar2 = new LinePlot($data_total_virii);
    $bar2->SetColor('red');
    $bar2->SetFillColor('red');
    $bar2->SetLegend('Virii');
    $bar3 = new LinePlot($data_total_spam);
    $bar3->SetColor('pink');
    $bar3->SetFillColor('pink');
    $bar3->SetLegend('Spam');
    $line1 = new LinePlot($data_total_size);
    //$line1->SetColor('green');
    $line1->SetFillColor('green');
    $line1->SetLegend('Volume (' . $size_info['shortdesc'] . ')');
    $line1->SetCenter();
    //$abar1 = new AccBarPlot(array($bar2,$bar3));
    //$gbplot = new GroupBarPlot(array($bar1,$abar1));
    $graph->Add($bar1);
    $graph->Add($bar2);
    $graph->Add($bar3);
    //$graph->Add($gbplot);
    $graph->Stroke($filename);
}
echo "<TABLE BORDER=\"0\" CELLPADDING=\"10\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
echo " <TD ALIGN=\"CENTER\"><IMG SRC=\"" . IMAGES_DIR . MS_LOGO . "\" ALT=\"MailScanner Logo\"></TD>";
echo " <TR>\n";
//  Check Permissions to see if the file has been written and that apache to read it.
if (is_readable($filename)) {
    echo " <TD ALIGN=\"CENTER\"><IMG SRC=\"" . $filename . "\" ALT=\"Graph\"></TD>";
} else {
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:rep_mrtg_style.php

示例14: Pegawai

$bplot2->SetCenter(0.4, 0.5);
$bplot2->SetLegend("Belanja Pegawai(%)");
$graph->Add($bplot2);
$bplot3 = new LinePlot($sbx_grafik_3);
$bplot3->mark->SetType(MARK_FILLEDCIRCLE);
$bplot3->mark->SetFillColor("brown");
$bplot3->mark->SetWidth(8);
$bplot3->SetColor("orange");
$bplot3->SetWeight(3);
$bplot3->value->Show();
$bplot3->value->SetFont(FF_ARIAL, FS_BOLD, 10);
$bplot3->value->SetAngle(30);
$bplot3->SetCenter(0.4, 0.5);
$bplot3->SetLegend("Belanja Barang(%)");
$graph->Add($bplot3);
$bplot4 = new LinePlot($sbx_grafik_4);
$bplot4->mark->SetType(MARK_FILLEDCIRCLE);
$bplot4->mark->SetFillColor("#993399");
$bplot4->mark->SetWidth(8);
$bplot4->SetColor("#FFFF33");
$bplot4->SetWeight(3);
$bplot4->value->Show();
$bplot4->value->SetFont(FF_ARIAL, FS_BOLD, 10);
$bplot4->value->SetAngle(30);
$bplot4->SetCenter(0.4, 0.5);
$bplot4->SetLegend("Belanja Modal(%)");
$graph->Add($bplot4);
$graph->Stroke();
?>

开发者ID:abbeet,项目名称:server39,代码行数:29,代码来源:penarikan_menteri_grafik.php

示例15: graph_cumulative_bydate

function graph_cumulative_bydate($p_metrics, $p_graph_width = 300, $p_graph_height = 380)
{
    $t_graph_font = graph_get_font();
    error_check(is_array($p_metrics) ? count($p_metrics) : 0, plugin_lang_get('cumulative') . ' ' . lang_get('by_date'));
    if (plugin_config_get('eczlibrary') == ON) {
        $graph = new ezcGraphLineChart();
        $graph->background->color = '#FFFFFF';
        $graph->xAxis = new ezcGraphChartElementNumericAxis();
        $graph->data[0] = new ezcGraphArrayDataSet($p_metrics[0]);
        $graph->data[0]->label = plugin_lang_get('legend_reported');
        $graph->data[0]->color = '#FF0000';
        $graph->data[1] = new ezcGraphArrayDataSet($p_metrics[1]);
        $graph->data[1]->label = plugin_lang_get('legend_resolved');
        $graph->data[1]->color = '#0000FF';
        $graph->data[2] = new ezcGraphArrayDataSet($p_metrics[2]);
        $graph->data[2]->label = plugin_lang_get('legend_still_open');
        $graph->data[2]->color = '#000000';
        $graph->additionalAxis[2] = $nAxis = new ezcGraphChartElementNumericAxis();
        $nAxis->chartPosition = 1;
        $nAxis->background = '#005500';
        $nAxis->border = '#005500';
        $nAxis->position = ezcGraph::BOTTOM;
        $graph->data[2]->yAxis = $nAxis;
        $graph->xAxis->labelCallback = 'graph_date_format';
        $graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
        $graph->xAxis->axisLabelRenderer->angle = -45;
        $graph->legend->position = ezcGraph::BOTTOM;
        $graph->legend->background = '#FFFFFF80';
        $graph->driver = new ezcGraphGdDriver();
        //$graph->driver->options->supersampling = 1;
        $graph->driver->options->jpegQuality = 100;
        $graph->driver->options->imageFormat = IMG_JPEG;
        $graph->title = plugin_lang_get('cumulative') . ' ' . lang_get('by_date');
        $graph->options->font = $t_graph_font;
        $graph->renderToOutput($p_graph_width, $p_graph_height);
    } else {
        foreach ($p_metrics[0] as $i => $vals) {
            if ($i > 0) {
                $plot_date[] = $i;
                $reported_plot[] = $p_metrics[0][$i];
                $resolved_plot[] = $p_metrics[1][$i];
                $still_open_plot[] = $p_metrics[2][$i];
            }
        }
        $graph = new Graph($p_graph_width, $p_graph_height);
        $graph->img->SetMargin(40, 40, 40, 170);
        if (ON == plugin_config_get('jpgraph_antialias')) {
            $graph->img->SetAntiAliasing();
        }
        $graph->SetScale('linlin');
        $graph->yaxis->SetColor("red");
        $graph->SetY2Scale("lin");
        $graph->SetMarginColor('white');
        $graph->SetFrame(false);
        $graph->title->Set(plugin_lang_get('cumulative') . ' ' . lang_get('by_date'));
        $graph->title->SetFont($t_graph_font, FS_BOLD);
        $graph->legend->Pos(0.05, 0.9, 'right', 'bottom');
        $graph->legend->SetShadow(false);
        $graph->legend->SetFillColor('white');
        $graph->legend->SetLayout(LEGEND_HOR);
        $graph->legend->SetFont($t_graph_font);
        $graph->yaxis->scale->ticks->SetDirection(-1);
        $graph->yaxis->SetFont($t_graph_font);
        $graph->y2axis->SetFont($t_graph_font);
        if (FF_FONT2 <= $t_graph_font) {
            $graph->xaxis->SetLabelAngle(60);
        } else {
            $graph->xaxis->SetLabelAngle(90);
            # can't rotate non truetype fonts
        }
        $graph->xaxis->SetLabelFormatCallback('graph_date_format');
        $graph->xaxis->SetFont($t_graph_font);
        $p1 = new LinePlot($reported_plot, $plot_date);
        $p1->SetColor('blue');
        $p1->SetCenter();
        $p1->SetLegend(plugin_lang_get('legend_reported'));
        $graph->AddY2($p1);
        $p3 = new LinePlot($still_open_plot, $plot_date);
        $p3->SetColor('red');
        $p3->SetCenter();
        $p3->SetLegend(plugin_lang_get('legend_still_open'));
        $graph->Add($p3);
        $p2 = new LinePlot($resolved_plot, $plot_date);
        $p2->SetColor('black');
        $p2->SetCenter();
        $p2->SetLegend(plugin_lang_get('legend_resolved'));
        $graph->AddY2($p2);
        if (helper_show_query_count()) {
            $graph->subtitle->Set(db_count_queries() . ' queries (' . db_time_queries() . 'sec)');
            $graph->subtitle->SetFont($t_graph_font, FS_NORMAL, 8);
        }
        $graph->Stroke();
    }
}
开发者ID:kaos,项目名称:mantisbt,代码行数:94,代码来源:graph_api.php


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