本文整理汇总了PHP中RadarPlot::SetLegend方法的典型用法代码示例。如果您正苦于以下问题:PHP RadarPlot::SetLegend方法的具体用法?PHP RadarPlot::SetLegend怎么用?PHP RadarPlot::SetLegend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RadarPlot
的用法示例。
在下文中一共展示了RadarPlot::SetLegend方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_radar.php';
// Some data to plot
$data = array(55, 80, 26, 31, 95);
// Create the graph and the plot
$graph = new RadarGraph(250, 200);
// Add a drop shadow to the graph
$graph->SetShadow();
// Create the titles for the axis
$titles = $gDateLocale->GetShortMonth();
$graph->SetTitles($titles);
$graph->SetColor('lightyellow');
// ADjust the position to make more room
// for the legend
$graph->SetCenter(0.45, 0.5);
// Add grid lines
$graph->grid->Show();
$graph->grid->SetColor('darkred');
$graph->grid->SetLineStyle('dashed');
$plot = new RadarPlot($data);
$plot->SetFillColor('lightblue');
$plot->SetLegend("QA results");
// Add the plot and display the graph
$graph->Add($plot);
$graph->Stroke();
示例2: RadarPlot
$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");
$plot2->SetFill(false);
// Add the plots to the graph
$graph->Add($plot2);
$graph->Add($plot);
// And output the graph
$graph->Stroke();
示例3: print_graph
//.........这里部分代码省略.........
$yaxislblmargin = $pmb - 15;
if ($longestlabel && !$overlap) {
// if legend showing
$pmr = $longestlabel * 5 + 40;
}
$graph->legend->Pos(0.02, 0.1, 'right', 'top');
}
}
}
}
}
// DRAW THE GRAPHS
if ($type == 'pie') {
$p1 = new PiePlot($data[0]);
$p1->SetSliceColors($colours);
if ($show_values) {
$p1->value->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
if ($percent) {
$p1->SetLabelType(PIE_VALUE_PERADJ);
} else {
$p1->SetLabelType(PIE_VALUE_ABS);
}
if ($percent || $show_percent) {
$p1->value->SetFormat("%d%%");
} else {
$p1->value->SetFormat("%s");
}
// Enable and set policy for guide-lines. Make labels line up vertically
$p1->SetGuideLines(true);
$p1->SetGuideLinesAdjust(1.5);
} else {
$p1->value->Show(false);
}
$p1->SetLegends($legends);
$p1->SetSize($psize);
$p1->SetCenter($pposx, $pposy);
if ($labels[0]) {
$graph->subtitle->Set($labels[0]);
$graph->subtitle->SetMargin(10 * $k);
$graph->subtitle->SetFont(FF_USERFONT, FS_BOLD, 11 * $k);
$graph->subtitle->SetColor("black");
}
$graph->Add($p1);
} else {
if ($type == 'pie3d') {
$p1 = new PiePlot3d($data[0]);
$p1->SetSliceColors($colours);
if ($show_values) {
$p1->value->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
if ($percent) {
$p1->SetLabelType(PIE_VALUE_PERADJ);
} else {
$p1->SetLabelType(PIE_VALUE_ABS);
}
if ($percent || $show_percent) {
$p1->value->SetFormat("%d%%");
} else {
$p1->value->SetFormat("%s");
}
} else {
$p1->value->Show(false);
}
$p1->SetLegends($legends);
$p1->SetEdge();
$p1->SetSize($psize);
$p1->SetCenter($pposx, $pposy);
示例4: array
// Some data to plot
$data = array(55, 80, 26, 31, 95);
$data2 = array(15, 50, 46, 39, 25);
// Create the graph and the plot
$graph = new RadarGraph(250, 200);
// Add a drop shadow to the graph
$graph->SetShadow();
// Create the titles for the axis
$titles = $gDateLocale->GetShortMonth();
$graph->SetTitles($titles);
$graph->SetColor('lightyellow');
// ADjust the position to make more room
// for the legend
$graph->SetCenter(0.4, 0.55);
$graph->SetSize(0.6);
// Add grid lines
$graph->grid->Show();
$graph->grid->SetColor('darkred');
$graph->grid->SetLineStyle('dotted');
$plot = new RadarPlot($data);
$plot->SetFillColor('lightblue');
$plot->SetLegend("QA results");
$plot2 = new RadarPlot($data2);
$plot2->SetLegend("Target");
$plot2->SetColor('red');
$plot2->SetFill(false);
$plot2->SetLineWeight(2);
// Add the plot and display the graph
$graph->Add($plot);
$graph->Add($plot2);
$graph->Stroke();
示例5: radarGraph_3
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;
}
示例6: RadarGraph
<?php
// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_radar.php';
$graph = new RadarGraph(300, 300);
$graph->SetScale('lin', 0, 50);
$graph->yscale->ticks->Set(25, 5);
$graph->SetColor('white');
$graph->SetShadow();
$graph->SetCenter(0.5, 0.55);
$graph->axis->SetFont(FF_FONT1, FS_BOLD);
$graph->axis->SetWeight(2);
// Uncomment the following lines to also show grid lines.
$graph->grid->SetLineStyle('dashed');
$graph->grid->SetColor('navy@0.5');
$graph->grid->Show();
$graph->ShowMinorTickMarks();
$graph->title->Set('Quality result');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->SetTitles(array('One', 'Two', 'Three', 'Four', 'Five', 'Sex', 'Seven', 'Eight', 'Nine', 'Ten'));
$plot = new RadarPlot(array(12, 35, 20, 30, 33, 15, 37));
$plot->SetLegend('Goal');
$plot->SetColor('red', 'lightred');
$plot->SetFillColor('lightblue');
$plot->SetLineWeight(2);
$graph->Add($plot);
$graph->Stroke();
示例7: RadarPlot
$graph->SetTitles($data['legend']);
$graph->SetCenter(0.5, 0.55);
$graph->HideTickMarks();
$graph->SetColor($background);
$graph->grid->SetColor('darkgray');
$graph->grid->Show();
$graph->axis->title->SetMargin(5);
$graph->SetGridDepth(DEPTH_BACK);
$graph->SetSize(0.6);
$plot = new RadarPlot($data['values']);
$color = $options['graph_color'];
$plot->SetColor($color);
$plot->SetLineWeight(1);
$plot->mark->SetType(MARK_IMG_SBALL, 'red');
if (!empty($options['graph_point_legend'])) {
$plot->SetLegend($options['graph_point_legend']);
}
if (!empty($options['graph_radar_fill'])) {
$plot->SetFillColor($color);
}
/*
// Todo: Add the possibility to add multiple graphs into one radar, they look nifty.
// Uncomment the lines below if you want to see it (number of $data2 && $data3 array elements must match those of the provided data.
$data2 = array(45,44,90,20,140);
$data3 = array(23,34,45,8,97);
$plot2 = new RadarPlot($data2);
$plot2->SetColor('red@0.4');
$plot2->SetLineWeight(1);
$plot2->SetLegend("Goal 2008");