// Setup the bar graph //---------------------- $graph2 = new Graph($w, 110); $graph2->SetScale('linlin', 0, 0, $xmin, $xmax); $graph2->SetMargin($lm, $rm, 5, 10); $graph2->SetMarginColor('white'); $graph2->SetFrame(false); $graph2->SetBox(true); $graph2->xgrid->Show(); $graph2->xaxis->SetTickPositions($tickPositions, $minTickPositions); $graph2->xaxis->SetLabelFormatString('My', true); $graph2->xaxis->SetPos('max'); $graph2->xaxis->HideLabels(); $graph2->xaxis->SetTickSide(SIDE_DOWN); $b1 = new BarPlot($datay2, $datax); $b1->SetFillColor('teal'); $b1->SetColor('teal:1.2'); $graph2->Add($b1); //----------------------- // Create a multigraph //---------------------- $mgraph = new MGraph(); $mgraph->SetMargin(2, 2, 2, 2); $mgraph->SetFrame(true, 'darkgray', 2); $mgraph->Add($graph); $mgraph->Add($graph2, 0, 240); $mgraph->Stroke(); ?>
$bplot4 = new BarPlot($y4); // Adjust fill color $bplot4->SetFillColor('purple1'); $graph4->Add($bplot4); // Setup the titles $descibe4 = iconv('UTF-8', 'ASCII//TRANSLIT', tr("octeam_stat_m_caches")); $graph4->title->Set($descibe4); $graph4->xaxis->title->Set(iconv('UTF-8', 'ASCII//TRANSLIT', tr('number_month')) . '2014/2015'); $graph4->xaxis->SetTickLabels($x4); $graph4->yaxis->title->Set($ncaches); $graph4->title->SetFont(FF_FONT1, FS_BOLD); $graph4->yaxis->title->SetFont(FF_FONT1, FS_BOLD); $graph4->xaxis->title->SetFont(FF_FONT1, FS_BOLD); // Setup the values that are displayed on top of each bar $bplot4->value->Show(); // Must use TTF fonts if we want text at an arbitrary angle $bplot4->value->SetFont(FF_FONT1, FS_BOLD); $bplot4->value->SetAngle(0); $bplot4->value->SetFormat('%d'); //----------------------- // Create a multigraph //---------------------- $mgraph = new MGraph(); $mgraph->SetMargin(10, 10, 10, 10); $mgraph->SetFrame(true, 'darkgray', 2); $mgraph->Add($graph); $mgraph->Add($graph3, 0, 220); $mgraph->Add($graph2, 0, 440); $mgraph->Add($graph4, 0, 660); $mgraph->Stroke(); }
$widthWeek = 70 * $contributionStat['nbCols'] + 100 + $legendWidth; $widthTotal = 70 + 100 + $legendWidth + $yTickWidth; $height = 250; $widthUser = 70 * $userContributions['nbCols'] + 100 + $legendWidth + $yTickWidth; $widthGroup = 70 * count($groupContributions) + 100 + $legendWidth + $yTickWidth; $space = 20; if ($prefs['feature_jpgraph'] == 'y') { require_once 'lib/jpgraph/src/jpgraph.php'; require_once 'lib/jpgraph/src/jpgraph_bar.php'; require_once 'lib/jpgraph/src/jpgraph_mgraph.php'; $imagegallib = TikiLib::lib('imagegal'); $ext = 'jpeg'; $background = new MGraph(); $background->SetImgFormat($ext); $background->SetFrame(true, 'black'); $background->SetMargin(10, 10, 10, 10); } else { require_once 'lib/sheet/grid.php'; require_once 'lib/graph-engine/gd.php'; require_once 'lib/graph-engine/pdflib.php'; require_once 'lib/graph-engine/ps.php'; require_once 'lib/graph-engine/graph.pie.php'; require_once 'lib/graph-engine/graph.bar.php'; require_once 'lib/graph-engine/graph.multiline.php'; $graphType = 'BarStackGraphic'; $ext = 'jpg'; $background = new GD_GRenderer(max($widthUser, $widthWeek), 8 * $height, $ext); $legendWidth = 300; } include_once 'lib/smarty_tiki/modifier.tiki_short_date.php'; $period = ' (' . smarty_modifier_tiki_short_date($startDate);