예제 #1
0
 public function createScoreByThemeGraphic($questionnaireId, $userId, $filepath, $verificador = false)
 {
     $graphDefinitions = $this->getScoreByThemeGraphicDefinitions($questionnaireId, $userId, $verificador);
     $graph = new RadarGraph(600, 300);
     $graph->SetColor("white");
     $graph->SetShadow();
     $graph->SetCenter(0.52, 0.55);
     $graph->HideTickMarks();
     $graph->SetTitles($graphDefinitions['ThemeNames']);
     $graph->yscale->SetAutoMax(100);
     $graph->title->Set("Ciclo " . date('Y'));
     $graph->title->SetFont(FF_FONT1, FS_BOLD);
     $graph->axis->SetFont(FF_FONT1, FS_NORMAL);
     $graph->axis->SetWeight(1);
     $graph->axis->SetColor("darkgray");
     $graph->grid->SetLineStyle("dashed");
     $graph->grid->SetColor("darkgray");
     $graph->grid->SetWeight(1);
     $graph->grid->Show();
     $actual = new RadarPlot($graphDefinitions['ThemeScores']);
     $actual->SetColor('darkorchid4', 'bisque');
     $actual->SetLineWeight(4);
     $graph->Add($actual);
     return $graph->Stroke($filepath);
 }
예제 #2
0
require_once 'jpgraph/jpgraph_radar.php';
// Create the basic radar graph
$graph = new RadarGraph(300, 200);
$graph->img->SetAntiAliasing();
// Set background color and shadow
$graph->SetColor("white");
$graph->SetShadow();
// Position the graph
$graph->SetCenter(0.4, 0.55);
// Setup the axis formatting
$graph->axis->SetFont(FF_FONT1, FS_BOLD);
// Setup the grid lines
$graph->grid->SetLineStyle("solid");
$graph->grid->SetColor("navy");
$graph->grid->Show();
$graph->HideTickMarks();
// Setup graph titles
$graph->title->Set("Quality result");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->SetTitles($gDateLocale->GetShortMonth());
// Create the first radar plot
$plot = new RadarPlot(array(70, 80, 60, 90, 71, 81, 47));
$plot->SetLegend("Goal");
$plot->SetColor("red", "lightred");
$plot->SetFill(false);
$plot->SetLineWeight(2);
// Create the second radar plot
$plot2 = new RadarPlot(array(70, 40, 30, 80, 31, 51, 14));
$plot2->SetLegend("Actual");
$plot2->SetLineWeight(2);
$plot2->SetColor("blue");
예제 #3
0
 public function radarGraph_3(&$data, &$data_pro, $project_id)
 {
     require_once '../app/classes/jpgraph/jpgraph_radar.php';
     require_once '../app/classes/jpgraph/jpgraph_iconplot.php';
     //数组处理
     $title_array = array();
     $sys_array = array();
     $pro_array = array();
     foreach ($data['advantage']['value'] as $value) {
         $data_pro_tmp = $data_pro;
         $title_array[] = $value['chs_name'];
         $sys_array[] = $value['score'];
         $data_pro_tmp = array_flip($data_pro_tmp);
         $key = $data_pro_tmp[trim($value['chs_name'])];
         $pro_array[] = $data_pro[$key + 1];
     }
     foreach ($data['disadvantage']['value'] as $value) {
         $data_pro_tmp = $data_pro;
         $title_array[] = $value['chs_name'];
         $sys_array[] = $value['score'];
         $data_pro_tmp = array_flip($data_pro_tmp);
         $key = $data_pro_tmp[trim($value['chs_name'])];
         $pro_array[] = $data_pro[$key + 1];
     }
     // Create the basic rtadar graph
     $graph = new RadarGraph(600, 450);
     // Set background color and shadow
     $graph->SetColor("white");
     // 		$graph->SetShadow();
     // Position the graph
     $graph->SetCenter(0.45, 0.5);
     $graph->SetTitles($title_array);
     // Setup the axis formatting
     $graph->axis->title->SetFont(FF_CHINESE, FS_NORMAL, 11);
     $graph->axis->SetFont(FF_FONT1, FS_BOLD, 11);
     $graph->axis->SetWeight(1);
     // Setup the grid lines
     $graph->grid->SetLineStyle("solid");
     $graph->grid->SetColor("gray");
     $graph->grid->Show();
     $graph->SetGridDepth(DEPTH_BACK);
     $graph->SetSize(0.6);
     $graph->HideTickMarks();
     // Setup graph titles
     // Create the first radar plot
     $plot = new RadarPlot($pro_array);
     $plot->SetLegend("胜任标准");
     $plot->SetColor("blue", "lightblue");
     $plot->SetFill(false);
     $plot->SetLineWeight(3);
     // Create the second radar plot
     $plot2 = new RadarPlot($sys_array);
     $plot2->SetLegend("个人测评值");
     $plot2->SetColor("red", "lightred");
     $plot2->mark->SetType(MARK_IMG_SBALL, 'red');
     $plot2->SetFill(false);
     $plot2->SetLineWeight(3);
     // Add the plots to the graph
     $graph->Add($plot);
     $graph->Add($plot2);
     $date = date('H_i_s');
     $stamp = rand(100, 900);
     $fileName = './tmp/' . $project_id . $date . '_' . $stamp . '.jpeg';
     $graph->Stroke($fileName);
     return $fileName;
 }