本文整理汇总了PHP中Graph::SetShadow方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::SetShadow方法的具体用法?PHP Graph::SetShadow怎么用?PHP Graph::SetShadow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::SetShadow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: barcart
function barcart($datay)
{
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_bar.php";
// Setup the graph.
$graph = new Graph(660, 250);
$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);
// Setup the titles
$graph->title->Set('NHR Registry');
$graph->xaxis->title->Set('X-title');
$graph->yaxis->title->Set('Y-title');
// Create the bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$graph->Add($bplot);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
return $graph;
}
示例2: plot
function plot($pid)
{
$this->_setValues($pid);
$graph = new Graph(600, 400);
$graph->img->SetMargin(60, 95, 40, 40);
$graph->SetShadow();
$graph->SetScale("textlog");
$colors = array("yellow", "green", "blue", "red");
srand(1);
for ($i = 0; $i < sizeof($this->_data); $i++) {
$bplot[$i] = new BarPlot($this->_data[$i]);
$color = $colors[$i];
$bplot[$i]->SetFillColor($color);
$bplot[$i]->SetLegend($this->_legend[$i]);
}
$gbplot = new GroupBarPlot($bplot);
$graph->Add($gbplot);
$graph->title->Set("# of Visited Articles per Language (log scale)");
$graph->title->SetFont(FONT2_BOLD);
$graph->xaxis->SetTickLabels($this->_years);
$graph->ygrid->Show(true, true);
$graph->xaxis->SetFont(FONT1_BOLD);
$graph->yaxis->SetFont(FONT1_BOLD);
$graph->Stroke();
}
示例3: plot
function plot($pid)
{
$this->_setValues($pid);
$graph = new Graph(600, 400);
$graph->img->SetMargin(60, 95, 40, 40);
$graph->SetShadow();
$graph->SetScale("textlog");
$colors = array("hotpink", "green", "blue", "gold", "blueviolet", "deepskyblue", "brown", "cadetblue", "darksalmon", "cornflowerblue", "darkslateblue", "limegreen", "yellow", "navy", "slategray");
srand(1);
for ($i = 0; $i < sizeof($this->_data); $i++) {
$bplot[$i] = new BarPlot($this->_data[$i]);
if ($i < sizeof($colors)) {
$color = $colors[$i];
} else {
$r = rand(0, 255);
$g = rand(0, 255);
$b = rand(0, 255);
$color = array($r, $g, $b);
}
$bplot[$i]->SetFillColor($color);
$bplot[$i]->SetLegend($this->_legend[$i]);
}
$gbplot = new GroupBarPlot($bplot);
$graph->Add($gbplot);
$graph->title->Set("# of Visited Articles per Month (log scale)");
$graph->title->SetFont(FONT2_BOLD);
$graph->xaxis->SetTickLabels($this->_months);
$graph->ygrid->Show(true, true);
$graph->xaxis->SetFont(FONT1_BOLD);
$graph->yaxis->SetFont(FONT1_BOLD);
$graph->Stroke();
}
示例4: barGraph_2
public function barGraph_2($data, $examinee_id, $color = 'green')
{
require_once '../app/classes/jpgraph/jpgraph_bar.php';
// Create the graph. These two calls are always required
$graph = new Graph(400, 334);
$graph->SetScale('textlin');
$graph->SetShadow(true, 5, 'white');
// Adjust the margin a bit to make more room for titles
$graph->SetMargin(40, 30, 20, 40);
$graph->SetFrame(true, 'black', 1);
// Create a bar pot
$datay = array();
$datalabel = array();
foreach ($data as $value) {
$datay[] = $value['score'];
$datalabel[] = $value['chs_name'];
}
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor($color);
$bplot->SetShadow("white");
$graph->Add($bplot);
// Setup labels
$lbl = $datalabel;
$graph->xaxis->SetTickLabels($lbl);
$graph->xaxis->SetFont(FF_CHINESE, FS_BOLD, 12);
// Send back the HTML page which will call this script again
// to retrieve the image.
//临时文件命名规范 $examinee_id_$date_rand(100,900)
$date = date('H_i_s');
$stamp = rand(100, 900);
$fileName = './tmp/' . $examinee_id . '_' . $date . '_' . $stamp . '.jpeg';
$graph->Stroke($fileName);
return $fileName;
}
示例5: index
public function index()
{
// We want a bar graph, so use JpGraph's bar chart library
require_once APPPATH . '/libraries/JpGraph/jpgraph_bar.php';
// Example data (04/2015)
$json = '[{"Hogwarts Academy":{"Yield":"19021 kWh","Yield specific":"127.01 kWh\\/kWp","Target yield":"16069.23 kWh","Current-target yield %":"<span style=\\"color: #3ab121\\">118.37 %<span>"}},{"cols": [{"id":"","label":"Time","pattern":"","type":"string"},{"id":"","label":"Hogwarts Academy (AC)","pattern":"","type":"number"},{"id":"","label":"Target values","pattern":"","type":"number"}], "rows": [{"c":[{"v":"01/04","f":null}, {"v":615.8,"f":"615,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"02/04","f":null}, {"v":712.5,"f":"712,50 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"03/04","f":null}, {"v":171,"f":"171,00 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"04/04","f":null}, {"v":382.3,"f":"382,30 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"05/04","f":null}, {"v":606.3,"f":"606,30 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"06/04","f":null}, {"v":774.5,"f":"774,50 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"07/04","f":null}, {"v":570.6,"f":"570,60 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"08/04","f":null}, {"v":726.8,"f":"726,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"09/04","f":null}, {"v":789.2,"f":"789,20 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"10/04","f":null}, {"v":592.9,"f":"592,90 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"11/04","f":null}, {"v":677.1,"f":"677,10 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"12/04","f":null}, {"v":244.5,"f":"244,50 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"13/04","f":null}, {"v":457.4,"f":"457,40 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"14/04","f":null}, {"v":340.8,"f":"340,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"15/04","f":null}, {"v":425.3,"f":"425,30 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"16/04","f":null}, {"v":828.8,"f":"828,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"17/04","f":null}, {"v":616.8,"f":"616,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"18/04","f":null}, {"v":660.3,"f":"660,30 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"19/04","f":null}, {"v":453.2,"f":"453,20 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"20/04","f":null}, {"v":691.9,"f":"691,90 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"21/04","f":null}, {"v":904.4,"f":"904,40 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"22/04","f":null}, {"v":879.1,"f":"879,10 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"23/04","f":null}, {"v":824.8,"f":"824,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"24/04","f":null}, {"v":777.9,"f":"777,90 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"25/04","f":null}, {"v":413.8,"f":"413,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"26/04","f":null}, {"v":834.8,"f":"834,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"27/04","f":null}, {"v":920.8,"f":"920,80 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"28/04","f":null}, {"v":751,"f":"751,00 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"29/04","f":null}, {"v":737.7,"f":"737,70 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]},{"c":[{"v":"30/04","f":null}, {"v":638.7,"f":"638,70 kWh"}, {"v":535.640966432,"f":"535,64 kWh"}]}]}]';
// Turn string into object
$obj = json_decode($json);
// Stores for graph data
$xdata = array();
$ydata = array();
// Get coords data from object
$obj_data = $obj[1]->rows;
$counter = 1;
// Add it to each of our storage arrays
foreach ($obj_data as $data) {
// only plot when there is a kW value
if (isset($data->c[1]->v)) {
$xdata[] = $data->c[0]->v;
// date
$ydata[] = $data->c[1]->v;
// kw
}
}
// Create the graph.
// One minute timeout for the cached image
// INLINE_NO means don't stream it back to the browser.
$graph = new Graph(600, 350, 'auto');
$graph->SetScale("textlin");
$graph->img->SetMargin(60, 30, 20, 40);
$graph->yaxis->SetTitleMargin(45);
$graph->yaxis->scale->SetGrace(30);
$graph->SetShadow();
// Turn the tickmarks
$graph->xaxis->SetTickSide(SIDE_DOWN);
$graph->yaxis->SetTickSide(SIDE_LEFT);
// Create a bar pot
$bplot = new BarPlot($ydata);
$bplot->SetFillColor("orange");
// Use a shadow on the bar graphs (just use the default settings)
$bplot->SetShadow();
$bplot->value->SetFormat(" %2.1f kW", 70);
$bplot->value->SetFont(FF_VERDANA, FS_NORMAL, 8);
$bplot->value->SetColor("blue");
$bplot->value->Show();
$graph->Add($bplot);
$graph->title->Set("Hogwarts Academy");
$graph->xaxis->title->Set("Day");
$graph->yaxis->title->Set("Yield in kilowatt hours");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM();
}
示例6: makeGraph
function makeGraph($x_data, $y_data, $num_results, $title = "Statistics", $graph_type = "bar", $graph_scale = "textint")
{
// default graph info
$width = 600;
$height = 500;
$top = 60;
$bottom = 30;
$left = 80;
$right = 30;
if ($graph_type != 'csv' && $num_results == 0) {
header('Content-type: image/png');
readfile($GLOBALS['BASE_DIR'] . '/images/no-calls.png');
exit;
}
// Set the basic parameters of the graph
switch ($graph_type) {
case "line":
//do line graph here
break;
// not really a graph, returns comma seperated values
// not really a graph, returns comma seperated values
case "csv":
header("content-type: text/csv");
header('Content-Disposition: attachment; filename="statistics.csv"');
$columns = implode(',', $x_data);
$rows = implode(',', $y_data);
echo $columns . "\n" . $rows;
break;
case "bar":
default:
// bar is default
$graph = new Graph($width, 90 + 10 * $num_results, 'auto');
$graph->SetScale($graph_scale);
// Nice shadow
$graph->SetShadow();
$graph->Set90AndMargin($left, $right, $top, $bottom);
// Setup labels
$graph->xaxis->SetTickLabels($x_data);
// Label align for X-axis
$graph->xaxis->SetLabelAlign('right', 'center', 'right');
// Label align for Y-axis
$graph->yaxis->SetLabelAlign('center', 'bottom');
// Create a bar pot
$bplot = new BarPlot($y_data);
$bplot->SetFillColor("#708090");
$bplot->SetWidth(0.5);
$bplot->SetYMin(0);
//$bplot->SetYMin(1990);
$graph->title->Set($title);
$graph->Add($bplot);
$graph->Stroke();
}
}
示例7: iterationSummary
/**
*
*/
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();
}
示例8: bar_task
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;
}
示例9: LineGraph
function LineGraph($w, $h, $title, $data1, $data2, $datax, $output)
{
// Create the graph. These two calls are always required
$graph = new Graph($w, $h, "auto");
$graph->SetScale("textlin");
$graph->SetMarginColor('white');
$graph->SetFrame(true);
// Adjust the margin
$graph->img->SetMargin(40, 100, 20, 40);
$graph->SetShadow(false);
// Create the linear plot
$lineplot = new LinePlot($data1);
$lineplot->SetWeight(2);
$lineplot->SetColor("blue");
$lineplot->mark->SetType(MARK_DIAMOND);
$lineplot->mark->SetWidth(5);
$lineplot->mark->SetFillColor('blue');
$lineplot->value->SetMargin(-20);
$lineplot->value->show();
$lineplot->value->SetColor('blue');
$lineplot->value->SetFormat('%0.0f');
$lineplot->SetLegend($_SESSION[Tahun1]);
$lineplot2 = new LinePlot($data2);
$lineplot2->SetColor("green");
$lineplot2->SetWeight(2);
$lineplot2->mark->SetType(MARK_FILLEDCIRCLE);
$lineplot2->mark->SetWidth(3);
$lineplot2->mark->SetFillColor('green');
$lineplot2->value->show();
$lineplot2->value->SetColor('darkgreen');
$lineplot2->value->SetFormat('%0.0f');
$lineplot2->SetLegend($_SESSION[Tahun2]);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->xaxis->SetTickLabels($datax);
$graph->title->Set($title);
$graph->xaxis->title->Set("");
$graph->yaxis->title->Set("");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->Add($lineplot2);
$graph->legend->SetShadow(false);
$graph->legend->SetFillColor('white');
$graph->legend->SetPos(0.01, 0.88, 'right', 'center');
// Display the graph
$graph->Stroke($output);
}
示例10: drawGraph
public function drawGraph()
{
// generate graphic
$graph = new Graph($this->width, $this->height, "auto");
$graph->SetScale("textlin");
// add shadow
$graph->SetShadow();
// change border
$graph->img->SetMargin(40, 30, 20, 40);
$graph->legend->Pos(0.05, 0.05, "right", "top");
// generate bars
$bplot = new BarPlot(array_values($this->dataPdf));
$bplot->SetLegend($this->filesLabel);
$bplot2 = new BarPlot(array_values($this->dataFrontdoor));
$bplot2->SetLegend($this->frontdoorLabel);
$gbplot = new GroupBarPlot(array($bplot, $bplot2));
$graph->Add($gbplot);
// format bars
$bplot->SetFillColor('orange');
$bplot->SetShadow();
$bplot->SetFillGradient("orange", "yellow", GRAD_HOR);
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$bplot->value->SetFont(FF_FONT1, FS_BOLD);
//$bplot->value->SetAngle(45);
$bplot->value->SetColor("darkblue", "darkred");
$bplot2->SetFillColor('blue');
$bplot2->SetShadow();
$bplot2->SetFillGradient("blue", "lightblue", GRAD_HOR);
$bplot2->value->Show();
$bplot2->value->SetFormat('%d');
$bplot2->value->SetFont(FF_FONT1, FS_BOLD);
//$bplot2->value->SetAngle(45);
$bplot2->value->SetColor("darkgreen", "darkred");
// format graphic
$graph->title->Set($this->title);
$graph->xaxis->title->Set($this->xaxis);
$graph->yaxis->title->Set($this->yaxis);
$graph->xaxis->SetTickLabels(array_keys($this->dataPdf));
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->scale->SetGrace(35);
// show graphic
$graph->Stroke();
}
示例11: 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();
}
示例12: plot
function plot()
{
$this->_setValues();
$graph = new Graph(380, 250);
$graph->img->SetMargin(50, 30, 40, 40);
$graph->SetShadow();
$graph->SetColor("lightyellow");
$graph->SetScale("textlin");
$graph->title->Set($this->_graphTitle);
$graph->yaxis->SetColor("blue");
$graph->xaxis->SetColor("blue");
$graph->title->SetFont(FONT1_BOLD);
$graph->xaxis->SetTickLabels($this->_xaxisValues);
$lineplot = new LinePlot($this->_yaxisValues);
$lineplot->SetColor("red");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
}
示例13: generate_image
function generate_image()
{
global $percent, $legend;
// Create the graph. These two calls are always required
$graph = new Graph(550, 250);
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);
$graph->xaxis->SetLabelmargin(5);
$graph->xaxis->SetTickLabels($legend);
$graph->ygrid->SetFill(true, '#EFEFEF@0.5', '#BBCCFF@0.5');
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(50, 30, 20, 40);
// Create a bar pot
$bplot = new BarPlot($percent);
// Adjust fill color
$bplot->SetFillColor('#9999CC');
$bplot->SetShadow();
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL, FS_BOLD, 10);
$bplot->value->SetAngle(45);
$bplot->value->SetFormat('%0.0f');
// Width
$bplot->SetWidth(0.6);
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("PHP documentation");
$graph->xaxis->title->Set("Language");
$graph->yaxis->title->Set("Files up to date (%)");
$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('../www/images/revcheck/info_revcheck_php_all_lang.png');
}
示例14: displayGraph
//.........这里部分代码省略.........
foreach ($values as $x => $y) {
$G_YDATAS[] = $y;
}
}
}
}
}
}
}
}
}
}
}
}
//*****************************************//
// ***** ***** ***** ***** * * //
// * * * * * * * * * //
// * *** ***** ***** ***** ***** //
// * * * * * * * * * //
// ***** * * * * * * * //
//*****************************************//
// L I N E P L O T
if (sizeof($G_YDATAS) >= 1) {
// true no funciona porque cada cadena u otro valor que se retorne es valor "valido o verdadero"
// y equivale a true, entonces para diferenciarlo verdaderamente se compara con 'true'
$str = checkAttributes($G_TITLE, $G_TYPE, $G_LABEL_Y, $_MSJ_ERROR, $_MSJ_NOTHING);
if ($str != 'true') {
showError($str, $G_SIZE);
return;
}
if ($G_TYPE == 'lineplot') {
$graph = new Graph($G_SIZE[0], $G_SIZE[1], "auto");
if ($G_SHADOW) {
$graph->SetShadow();
}
$graph->SetScale($G_SCALE);
$graph->SetMarginColor($G_COLOR);
$graph->title->Set($G_TITLE);
$graph->SetFrame(true, '#999999');
$graph->img->SetMargin($G_MARGIN[0], $G_MARGIN[1], $G_MARGIN[2], $G_MARGIN[3]);
$graph->img->SetAntiAliasing();
$graph->xaxis->SetLabelFormatCallback("CallBack");
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->Set($G_LABEL[0]);
$graph->yaxis->title->Set($G_LABEL[1]);
$graph->xgrid->Show();
$graph->legend->SetFillColor("#fafafa");
$graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
$graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
$graph->legend->SetColor("#444444", "#999999");
$arr_lineplot = array();
foreach ($G_YDATAS as $num => $yDatas) {
$lineplot = new LinePlot($yDatas);
if ($G_ARR_STEP[$num] == true) {
$lineplot->SetStepStyle();
}
if ($G_ARR_FILL_COLOR[$num] == true) {
$lineplot->SetFillColor($G_ARR_COLOR[$num]);
}
$lineplot->SetColor($G_ARR_COLOR[$num]);
$lineplot->SetWeight($G_WEIGHT);
$lineplot->SetLegend($G_ARR_LEYEND[$num]);
$arr_lineplot[] = $lineplot;
}
foreach ($arr_lineplot as $num => $yDatas) {
$graph->Add($yDatas);
示例15: array
function generate_graph_image()
{
// Create the graph.
// Set up Font Mapping Arrays
$fontfamilies = array("Font 0" => FF_FONT0, "Font 1" => FF_FONT1, "Font 2" => FF_FONT2, "Font0" => FF_FONT0, "Font1" => FF_FONT1, "Font2" => FF_FONT2, "Arial" => FF_ARIAL, "Verdana" => FF_VERDANA, "Courier" => FF_COURIER, "Comic" => FF_COMIC, "Times" => FF_TIMES, "Georgia" => FF_GEORGIA, "Trebuchet" => FF_TREBUCHE, "advent_light" => advent_light, "Bedizen" => Bedizen, "Mukti_Narrow" => Mukti_Narrow, "calibri" => calibri, "Forgotte" => Forgotte, "GeosansLight" => GeosansLight, "MankSans" => MankSans, "pf_arma_five" => pf_arma_five, "Silkscreen" => Silkscreen, "verdana" => verdana, "Vera" => FF_VERA);
$fontstyles = array("Normal" => FS_NORMAL, "Bold" => FS_BOLD, "Italic" => FS_ITALIC, "Bold+Italic" => FS_BOLDITALIC);
$this->apply_defaults();
if (!function_exists("imagecreatefromstring")) {
handle_error("Graph Option Not Available. Requires GD2");
return;
}
if ($this->plot[0]["type"] == "PIE" || $this->plot[0]["type"] == "PIE3D") {
$graph = new PieGraph($this->width_actual, $this->height_actual, "auto");
$graph->SetScale("textlin");
$graph->img->SetMargin($this->marginleft_actual, $this->marginright_actual, $this->margintop_actual, $this->marginbottom_actual);
$graph->SetMarginColor($this->margincolor_actual);
$graph->img->SetAntiAliasing();
$graph->SetColor($this->graphcolor_actual);
$graph->SetShadow();
$graph->xaxis->SetTitleMargin($this->marginbottom_actual - 45);
$graph->yaxis->SetTitleMargin($this->marginleft_actual - 25);
} else {
$graph = new Graph($this->width_actual, $this->height_actual, "auto");
$graph->SetScale("textlin");
$graph->img->SetMargin($this->marginleft_actual, $this->marginright_actual, $this->margintop_actual, $this->marginbottom_actual);
$graph->SetMarginColor($this->margincolor_actual);
$graph->img->SetAntiAliasing();
$graph->SetColor($this->graphcolor_actual);
$graph->SetShadow();
$graph->xaxis->SetTitleMargin($this->marginbottom_actual - 45);
$graph->yaxis->SetTitleMargin($this->marginleft_actual - 25);
}
$lplot = array();
$lplotct = 0;
foreach ($this->plot as $k => $v) {
switch ($v["type"]) {
case "PIE":
$lplot[$lplotct] = new PiePlot($v["data"]);
$lplot[$lplotct]->SetColor($v["linecolor"]);
foreach ($xlabels as $k => $v) {
$xlabels[$k] = $v . "\n %.1f%%";
}
$lplot[$lplotct]->SetLabels($xlabels, 1.0);
$graph->Add($lplot[$lplotct]);
break;
case "PIE3D":
$lplot[$lplotct] = new PiePlot3D($v["data"]);
$lplot[$lplotct]->SetColor($v["linecolor"]);
foreach ($xlabels as $k => $v) {
$xlabels[$k] = $v . "\n %.1f%%";
}
$lplot[$lplotct]->SetLabels($xlabels, 1.0);
$graph->Add($lplot[$lplotct]);
break;
case "STACKEDBAR":
case "BAR":
$lplot[$lplotct] = new BarPlot($v["data"]);
$lplot[$lplotct]->SetColor($v["linecolor"]);
$lplot[$lplotct]->SetWidth(0.8);
//$lplot[$lplotct]->SetWeight(5);
if ($v["fillcolor"]) {
$lplot[$lplotct]->SetFillColor($v["fillcolor"]);
}
if ($v["legend"]) {
$lplot[$lplotct]->SetLegend($v["legend"]);
}
$graph->Add($lplot[$lplotct]);
break;
case "LINE":
default:
if (count($v["data"]) == 1) {
$v["data"][] = 0;
}
$lplot[$lplotct] = new LinePlot($v["data"]);
$lplot[$lplotct]->SetColor($v["linecolor"]);
//$lplot[$lplotct]->SetWeight(5);
if ($v["fillcolor"]) {
$lplot[$lplotct]->SetFillColor($v["fillcolor"]);
}
if ($v["legend"]) {
$lplot[$lplotct]->SetLegend($v["legend"]);
}
$graph->Add($lplot[$lplotct]);
break;
}
$lplotct++;
}
$graph->title->Set($this->title_actual);
$graph->xaxis->title->Set($this->xtitle_actual);
$graph->yaxis->title->Set($this->ytitle_actual);
$graph->xgrid->SetColor($this->xgridcolor_actual);
$graph->ygrid->SetColor($this->ygridcolor_actual);
switch ($this->xgriddisplay_actual) {
case "all":
$graph->xgrid->Show(true, true);
break;
case "major":
$graph->xgrid->Show(true, false);
break;
case "minor":
//.........这里部分代码省略.........