本文整理汇总了PHP中Graph::AddY方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::AddY方法的具体用法?PHP Graph::AddY怎么用?PHP Graph::AddY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::AddY方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Graph
}
// Setup the graph
$graph = new Graph(450, 250);
$graph->SetMargin(40, 150, 40, 30);
$graph->SetMarginColor('white');
$graph->SetScale('intlin');
$graph->title->Set('Using multiple Y-axis');
$graph->title->SetFont(FF_ARIAL, FS_NORMAL, 14);
$graph->SetYScale(0, 'lin');
$graph->SetYScale(1, 'lin');
$graph->SetYScale(2, 'lin');
$p1 = new LinePlot($datay);
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$p2->SetColor('teal');
$graph->AddY(0, $p2);
$graph->ynaxis[0]->SetColor('teal');
$p3 = new LinePlot($datay3);
$p3->SetColor('red');
$graph->AddY(1, $p3);
$graph->ynaxis[1]->SetColor('red');
$p4 = new LinePlot($datay4);
$p4->SetColor('blue');
$graph->AddY(2, $p4);
$graph->ynaxis[2]->SetColor('blue');
// Output line
$graph->Stroke();
?>
示例2: displayGraph
//.........这里部分代码省略.........
$graph->SetScale($G_SCALE);
$graph->SetFrame(true, '#999999');
$graph->title->Set($G_TITLE);
$graph->img->SetAntiAliasing();
$graph->xaxis->SetLabelFormatCallback("CallBack");
$graph->img->SetMargin($G_MARGIN[0], $G_MARGIN[1], $G_MARGIN[2], $G_MARGIN[3]);
$graph->SetMarginColor($G_COLOR);
$graph->legend->SetFillColor("#fafafa");
$graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
$graph->xaxis->SetLabelAngle(90);
$graph->legend->SetColor("#444444", "#999999");
$graph->legend->SetShadow('gray@0.6', 4);
$graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
foreach ($G_YDATAS as $num => $yData) {
$lineplot = new LinePlot($yData);
$lineplot->SetWeight($G_WEIGHT);
$lineplot->SetLegend($G_ARR_LEYEND[$num]);
if ($G_ARR_STEP[$num] == true) {
$lineplot->SetStepStyle();
}
if ($G_ARR_FILL_COLOR[$num] == true) {
$lineplot->SetFillColor($G_ARR_COLOR[$num]);
}
if ($num == 0) {
$lineplot->SetColor($G_ARR_COLOR[$num]);
$graph->yaxis->SetColor($G_ARR_COLOR[$num]);
$graph->Add($lineplot);
} else {
$lineplot->SetColor($G_ARR_COLOR[$num]);
$graph->SetYScale($num - 1, 'lin');
$graph->ynaxis[$num - 1]->SetColor($G_ARR_COLOR[$num]);
$graph->ynaxis[$num - 1]->SetPosAbsDelta($G_MARGIN[1] + 49 * ($num - 1));
//mueve el eje Y
$graph->AddY($num - 1, $lineplot);
}
}
if (sizeof($xData) > 100) {
//$graph->xaxis->SetTextLabelInterval( (int)(sizeof($xData)/8) );
$graph->xaxis->SetTextTickInterval((int) (sizeof($xData) / 10));
//$graph->xaxis->SetTextTickInterval( 9*(int)(log(sizeof($xData))-1) );
}
$graph->Stroke();
} else {
if ($G_TYPE == 'bar') {
$g = new CanvasGraph(91, 21, 'auto');
$g->SetMargin(0, 0, 0, 0);
$g->InitFrame();
$xmax = 20;
$ymax = 20;
$scale = new CanvasScale($g);
$scale->Set(0, $G_SIZE[0], 0, $G_SIZE[1]);
//DUBUJA LA BARRA
$alto = $G_SIZE[1];
$ancho = $G_SIZE[0];
$coor_x = 0;
$coor_y = 0;
$porcentage = $G_YDATAS[0];
$valor = 90 * (1 - $porcentage);
$g->img->Line($coor_x, $coor_y, $coor_x + $ancho, $coor_y);
$g->img->Line($coor_x, $coor_y, $coor_x, $coor_y + $alto);
$g->img->Line($coor_x + $ancho, $coor_y, $coor_x + $ancho, $coor_y + $alto);
$g->img->Line($coor_x, $coor_y + $alto, $coor_x + $ancho, $coor_y + $alto);
for ($i = 0; $i < $alto; $i++) {
$g->img->SetColor(array(95 - 3 * $i, 138 - 3 * $i, 203 - 3 * $i));
//para hacerlo 3D, degradacion
$g->img->Line($coor_x, $coor_y + $i + 1, $coor_x + $ancho - $valor - 1, $coor_y + $i + 1);
示例3: LinePlot
$graph->yaxis->title->Set('Basic Rate');
$graph->yaxis->title->SetFont(FF_ARIAL, FS_BOLD, 10);
$graph->yaxis->title->SetColor('black');
$graph->Add($lp1);
// First multi Y-axis plot
$lp2 = new LinePlot($datay2);
$lp2->SetLegend('2002');
$lp2->mark->SetType(MARK_DIAMOND);
$lp2->mark->SetWidth(15);
$lp2->mark->SetFillColor('darkred');
$lp2->SetCSIMTargets($targ2, $alts2);
$graph->ynaxis[0]->SetColor('darkred');
$graph->ynaxis[0]->title->Set('Rate A');
$graph->ynaxis[0]->title->SetFont(FF_ARIAL, FS_BOLD, 10);
$graph->ynaxis[0]->title->SetColor('darkred');
$graph->AddY(0, $lp2);
// Second multi Y-axis plot
$lp3 = new LinePlot($datay3);
$lp3->SetLegend('2003');
$lp3->mark->SetType(MARK_DIAMOND);
$lp3->mark->SetWidth(15);
$lp3->mark->SetFillColor('darkgreen');
$lp3->SetCSIMTargets($targ3, $alts3);
$graph->ynaxis[1]->SetColor('darkgreen');
$graph->ynaxis[1]->title->Set('Rate B');
$graph->ynaxis[1]->title->SetFont(FF_ARIAL, FS_BOLD, 10);
$graph->ynaxis[1]->title->SetColor('darkgreen');
$graph->AddY(1, $lp3);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM();
示例4: LinePlot
$graph->ynaxis[1]->title->SetFont(FF_FONT1, FS_BOLD, 12);
$graph->ynaxis[1]->SetTitleMargin(45);
$graph->ynaxis[1]->SetColor("black", "black");
$graph->ynaxis[1]->SetLabelFormat('%0.3f');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.01, 0.05);
$graph->legend->SetFont(FF_FONT1, FS_BOLD, 14);
// Create the linear plot
$lineplot = new LinePlot($mph, $times);
$lineplot->SetLegend("Instant Wind Speed");
$lineplot->SetColor("red");
$lineplot2 = new LinePlot($alti, $times);
$lineplot2->SetLegend("Pressure");
$lineplot2->SetColor("black");
//if ($hasgust == 1){
// Create the linear plot
// $lp1=new LinePlot($gust);
// $lp1->SetLegend("Peak Wind Gust");
// $lp1->SetColor("black");
//}
// Create the linear plot
$sp1 = new ScatterPlot($drct, $times);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("blue");
$sp1->mark->SetWidth(3);
$sp1->SetLegend("Wind Direction");
$graph->Add($sp1);
$graph->AddY(0, $lineplot);
$graph->AddY(1, $lineplot2);
//$graph->AddY2($lp1);
$graph->Stroke();
示例5: LinePlot
$p2->mark->SetType(MARK_X, $MarkSize);
$p2->mark->SetColor("red");
if ($EnableMarkT == 'on') {
$p2->mark->Show();
} else {
$p2->mark->Hide();
}
$p2->SetWeight($LineWeight);
$p2->SetLegend("Temperature");
if ($AxisPtr == -1) {
$graph->Add($p2);
$graph->yaxis->SetColor('red');
$graph->yaxis->SetTitle('Temperature/°C', 'middle');
} else {
$graph->SetYScale($AxisPtr, 'lin');
$graph->AddY($AxisPtr, $p2);
$graph->ynaxis[$AxisPtr]->SetColor('red');
$graph->ynaxis[$AxisPtr]->SetTitle('Temperature/°C', 'middle');
}
$AxisPtr = $AxisPtr + 1;
}
//Moisture
if ($LineMoist == 'on') {
$p3 = new LinePlot($Moi_data, $arr_xticks);
$p3->SetColor('teal');
$p3->mark->SetType(MARK_X, $MarkSize);
$p3->mark->SetColor("teal");
if ($EnableMarkM == 'on') {
$p3->mark->Show();
} else {
$p3->mark->Hide();