public function catpcha() { JpGraph\JpGraph::load(); JpGraph\JpGraph::module('antispam'); $spam = new AntiSpam(); $_SESSION['catpcha'] = $spam->Rand(6); $spam->Stroke(); }
/** * */ public function iterationSummary($id) { $iteration = Iterations::findOrFail($id); $issues = Issue::where('iterationid', '=', $iteration->id)->get(); $tasksId = array(); foreach ($issues as $issue) { $tasksId[] = $issue->id; } $tasks = Task::whereIn('issueid', $tasksId)->get(); $countTODO = 0; $countDOING = 0; $countDONE = 0; foreach ($tasks as $task) { switch ($task->scrumid) { case 1: $countTODO++; break; case 2: $countDOING++; break; case 3: $countDONE++; break; } } JpGraph\JpGraph::load(); JpGraph\JpGraph::module('bar'); $l1datay = array($countTODO, $countDOING, $countDONE); //$datax=array('TO-DO','DOING','DONE'); $datax = array('POR HACER', 'HACIENDO', 'HECHAS'); //Create the graph $graph = new Graph(700, 300); $graph->SetScale('textlin'); $graph->img->SetMargin(60, 130, 40, 60); $graph->SetShadow(); // Create the linear error plot $l1plot = new BarPlot($l1datay); $l1plot->SetColor('red'); $l1plot->SetWeight(2); $l1plot->SetLegend('Avance de iteracion'); // Add the plots to t'he graph $graph->Add($l1plot); $graph->xaxis->SetTickLabels($datax); $graph->title->Set('Tareas'); //$graph->xaxis->title->Set('Estados'); //$graph->yaxis->title->Set('Cantidad'); $graph->title->SetFont(FF_FONT1, FS_BOLD); $graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD); //Display the graph $graph->Stroke(); }
/** * */ public function summary($id) { $iterationAux; //try { $project = Project::findOrFail($id); $iterations = Iterations::where('projectid', '=', $id)->get(); //foreach($iterations as $var){ // $iterationAux = $iterationAux . var_dump($var); //} //}catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) { //} //die; JpGraph\JpGraph::load(); JpGraph\JpGraph::module('bar'); JpGraph\JpGraph::module('line'); $datay = array(20, 30, 50, 80); $datay2 = array(30, 95, 70, 40); $datazero = array(0, 0, 0, 0); // Create the graph. $graph = new Graph(800, 500); $graph->title->Set('Example with 2 scale bars : ' . $project->name . ' : ' . $id . ' : ' . sizeof($iterations)); // Setup Y and Y2 scales with some "grace" $graph->SetScale("textlin"); $graph->SetY2Scale("lin"); //$graph->yaxis->scale->SetGrace(30); //$graph->y2axis->scale->SetGrace(30); //$graph->ygrid->Show(true,true); $graph->ygrid->SetColor('gray', 'lightgray@0.5'); // Setup graph colors $graph->SetMarginColor('white'); $graph->y2axis->SetColor('darkred'); // Create the "dummy" 0 bplot $bplotzero = new BarPlot($datazero); // Create the "Y" axis group $ybplot1 = new BarPlot($datay); $ybplot1->value->Show(); $ybplot = new GroupBarPlot(array($ybplot1, $bplotzero)); // Create the "Y2" axis group $ybplot2 = new BarPlot($datay2); $ybplot2->value->Show(); $ybplot2->value->SetColor('darkred'); $ybplot2->SetFillColor('darkred'); $y2bplot = new GroupBarPlot(array($bplotzero, $ybplot2)); // Add the grouped bar plots to the graph $graph->Add($ybplot); $graph->AddY2($y2bplot); $datax = array('A', 'B', 'C', 'D'); $graph->xaxis->SetTickLabels($datax); // .. and finally stroke the image back to browser $graph->Stroke(); }
public function bar_task($id) { $help = new Helper(); $issues = $help->searchIssues($id); //foreach ($issues as $issue) { # code... // $issue->id //} //$iteration = Iterations::findOrFail($id); //$idTmp = $iteration->id; // $issues = Issue::where('iterationid','=', $idTmp)->get(); //$issues = $iteration->issues; //$countIssues = sizeof($issues); $countIssues = 0; $dataEstimatedTime = array(); $dataRealTime = array(); $dataIterationName = array(); $countTODO = 0; $countDOING = 0; $countDONE = 0; //$string_iterations = implode(";", $iterations); JpGraph\JpGraph::load(); JpGraph\JpGraph::module('bar'); JpGraph\JpGraph::module('line'); $datay = array(12, 8, 19, 3, 10, 5); // Create the graph. These two calls are always required $graph = new Graph(300, 200); $graph->SetScale('textlin'); // Add a drop shadow $graph->SetShadow(); // Adjust the margin a bit to make more room for titles $graph->SetMargin(40, 30, 20, 40); // Create a bar pot $bplot = new BarPlot($datay); // Adjust fill color $bplot->SetFillColor('orange'); $graph->Add($bplot); // Setup the titles $graph->title->Set('A basic bar graph '); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); $graph->title->SetFont(FF_FONT1, FS_BOLD); $graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD); //$graph->Stroke(); //$response = Response::make( // $graph->Stroke() //); // $response->header('content-type', 'image/png'); // return $response; }
<?php // jpgraph_line.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("line");
<?php // jpgraph_date.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("date");
<?php // jpgraph_regstat.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("regstat");
<?php // jpgraph_canvas.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("canvas");
<?php // jpgraph_gb2312.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("gb2312");
<?php // jpgraph_flags.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("flags");
<?php // jpgraph_plotline.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("plotline");
<?php // jpgraph_bar.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("bar");
<?php // jpgraph_plotband.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("plotband");
<?php // jpgraph_antispam.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("antispam");
<?php // jpgraph_pie.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("pie");
<?php // jpgraph_iconplot.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("iconplot");
<?php // jpgraph_stock.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("stock");
<?php // jpgraph_windrose.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("windrose");
<?php // jpgraph_log.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("log");
<?php // jpgraph_antispam-digits.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("antispam-digits");
public function summary($id) { JpGraph\JpGraph::load(); JpGraph\JpGraph::module('line'); $targ1 = array(); $targ2 = array(); $targ3 = array(); $alts1 = array(); $alts2 = array(); $alts3 = array(); // Setup some dummy targets for the CSIM $n = 5; for ($i = 0; $i < $n; ++$i) { $targ1[$i] = "#{$i}"; $targ2[$i] = "#{$i}"; $targ3[$i] = "#{$i}"; $alts1[$i] = "val=%d"; $alts2[$i] = "val=%d"; $alts3[$i] = "val=%d"; } $datay1 = array(20, 15, 23, 15, 80, 20, 45, 10, 5, 45, 60); $datay2 = array(12, 9, 12, 8, 41, 15, 30, 8, 48, 36, 14, 25, 30, 35); $datay3 = array(5, 17, 32, 24, 4, 2, 36, 2, 9, 24, 21, 23); $dateStart = '2015-03-01'; $dateEnd = '2016-04-30'; $numberTotalDays = $this->numberDaysBetweenTwoDates($dateStart, $dateEnd); $numberTotalMonths = $this->numberMonthBetweenTwoDates($dateStart, $dateEnd); $yearStart = $this->obtainInfoDate($dateStart, "Y"); $monthStart = $this->obtainInfoDate($dateStart, 'n'); $dayStart = $this->obtainInfoDate($dateStart, 'd'); $yearEnd = $this->obtainInfoDate($dateEnd, "Y"); $monthEnd = $this->obtainInfoDate($dateEnd, "n"); $dayEnd = $this->obtainInfoDate($dateEnd, "d"); $arrayDays = array(); $result = array(); $result[] = 0; $monthCount = $monthStart; $yearCount = $yearStart; $daysElapsed = 0; $percentaje = 0; $days = 0; $counter = 0; for ($i = 1; $i <= $numberTotalMonths; $i++) { if ($i == 1) { $days = $this->numberDaysFirstMonth($yearCount, $monthCount, $dayStart); $arrayDays[] = $monthCount . '+' . $days; $daysElapsed = $daysElapsed + $days; $percentaje = $this->calculatePercentage($numberTotalDays, $daysElapsed); $result[] = $percentaje; } elseif ($i == $numberTotalMonths) { $days = $dayEnd; $arrayDays[] = $monthCount . '+' . $days; $daysElapsed = $daysElapsed + $days; $percentaje = $this->calculatePercentage($numberTotalDays, $daysElapsed); $result[] = $percentaje; } else { $days = $this->numberDaysPerMonth($yearCount, $monthCount); $arrayDays[] = $monthCount . '+' . $days; $daysElapsed = $daysElapsed + $days; $percentaje = $this->calculatePercentage($numberTotalDays, $daysElapsed); $result[] = $percentaje; } if ($monthCount == 12) { $monthCount = 0; $yearCount++; } $monthCount++; } $stringTmp = ''; foreach ($arrayDays as $var) { $stringTmp = $stringTmp . (string) $var . ' - '; } //$datay3 = $result; // Setup the graph $graph = new Graph(900, 350); //$graph->SetScale("textlin"); $graph->SetScale("intlin"); //$graph->SetYScale(0,'int'); //$graph->SetYScale(1,'int'); $theme_class = new UniversalTheme(); //$numberDays = $this->numberDaysBetweenTwoDates('2013-01-01','2014-01-01'); //$numberMonth = $this->numberMonthBetweenTwoDates('2013-01-01','2013-12-20'); //$month = $this->obtainInfoFromDate('2013-12-20'); //$yearStart = $this->obtainInfoDate('2013-12-20', "Y"); //$monthStart = $this->obtainInfoDate('2013-12-20', 'm'); //$dayStart = $this->obtainInfoDate('2013-12-20','d'); $graph->SetTheme($theme_class); $graph->img->SetAntiAliasing(false); //$numberTotalMonths = $this->numberMonthBetweenTwoDates($dateStart, $dateEnd); //$monthStart = $this->obtainInfoDate($dateStart, 'n'); //$monthEnd = $this->obtainInfoDate($dateEnd, 'n'); $monthNames = array('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'); // $result = array(); $counter = $monthStart - 1; $resultNames = array(); $resultNames[] = ''; for ($i = 0; $i < $numberTotalMonths; $i++) { $resultNames[] = $monthNames[$counter]; $counter++; if ($counter == 12) { $counter = 0; } } $graph->title->Set('Pedidos ' . $numberTotalMonths . ' , ' . $numberTotalDays . ' , ' . $daysElapsed . ' : ' . $stringTmp . ' ; ' . $monthStart); // $graph->title->Set('Evolución de pedidos ' . $numberTotalMonths . ' ' . $numberTotalDays . ' ' . $yearStart . ' ' . $monthStart . ' ' . $daysElapsed . ' ' . $percentaje . ' ' . $stringTmp); //$graph->title->Set('Evolución de pedidos ' . $numberTotalMonths);$arrayDays //$graph->title->Set('Evolución de pedidos'); $graph->SetBox(false); $graph->img->SetAntiAliasing(); $graph->yaxis->HideZeroLabel(); $graph->yaxis->HideLine(false); $graph->yaxis->HideTicks(false, false); $graph->xgrid->Show(); $graph->xgrid->SetLineStyle("solid"); //$months = $this->buildArrayMonthName('2015-01-01','2016-01-01'); //$graph->xaxis->SetTickLabels(array('Ene','Feb','Mar','Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Nov', 'Oct', 'Dic', 'Aux')); $graph->xaxis->SetTickLabels($resultNames); $graph->xgrid->SetColor('#E3E3E3'); // Create the first line $p1 = new LinePlot($datay1); $graph->Add($p1); $p1->SetColor("#6495ED"); $p1->SetLegend('Tienda 1'); // Create the second line $p2 = new LinePlot($datay2); $graph->Add($p2); $p2->SetColor("#B22222"); $p2->SetLegend('Tienda 2'); // Create the third line $p3 = new LinePlot($result); $graph->Add($p3); // $p3->SetColor("#55bbdd"); $p3->SetColor("blue"); $p3->SetLegend('Tienda 3'); $p3->SetCSIMTargets($targ1, $alts1); //----------- //$p3->value->SetFormat('%d'); $p3->value->Show(); $p3->value->SetColor('red'); $graph->legend->SetFrameWeight(1); // Output line $graph->Stroke(); }
<?php // jpgraph_mgraph.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("mgraph");
<?php // jpgraph_contour.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("contour");
<?php // jpgraph_table.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("table");
<?php // jpgraph_gantt.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("gantt");
<?php // jpgraph_gradient.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("gradient");
<?php // jpgraph_pie3d.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("pie3d");
<?php // jpgraph_scatter.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("scatter");
<?php // lib/JpGraph/lib_hack/jpgraph.php require_once __DIR__ . '/../JpGraph.php'; JpGraph\JpGraph::load();
<?php // jpgraph_radar.php require_once __DIR__ . '/jpgraph.php'; JpGraph\JpGraph::module("radar");