当前位置: 首页>>代码示例>>PHP>>正文


PHP Graph::SetYScale方法代码示例

本文整理汇总了PHP中Graph::SetYScale方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::SetYScale方法的具体用法?PHP Graph::SetYScale怎么用?PHP Graph::SetYScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Graph的用法示例。


在下文中一共展示了Graph::SetYScale方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rand

include "../jpgraph_line.php";
$n = 8;
for ($i = 0; $i < $n; ++$i) {
    $datay[$i] = rand(1, 10);
    $datay2[$i] = rand(10, 55);
    $datay3[$i] = rand(200, 600);
    $datay4[$i] = rand(500, 800);
}
// 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);
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:mulyaxisex1.php

示例2: displayGraph


//.........这里部分代码省略.........
                            if ($G_SHADOW) {
                                $graph->SetShadow();
                            }
                            $inc = sizeof($G_YDATAS);
                            $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);
开发者ID:hardikk,项目名称:HNH,代码行数:67,代码来源:paloSantoGraphImage.lib.php

示例3: array

    $alts2[$i] = "val=%d";
    $alts3[$i] = "val=%d";
}
// Some data for the points
$datay1 = array(3, 10, 4, 1, 6);
$datay2 = array(25, 22, 18, 24, 20);
$datay3 = array(89, 70, 92, 77, 96);
// Create a basic graph with some suitable margins
$graph = new Graph(500, 250);
$graph->SetMargin(60, 180, 50, 40);
$graph->SetMarginColor('white');
$graph->title->Set("Multi Y-axes with Image Map");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Setup the scales for all axes
$graph->SetScale("intlin");
$graph->SetYScale(0, 'int');
$graph->SetYScale(1, 'int');
// Standard Y-axis plot
$lp1 = new LinePlot($datay1);
$lp1->SetLegend('2001');
$lp1->mark->SetType(MARK_DIAMOND);
$lp1->mark->SetWidth(15);
$lp1->mark->SetFillColor('orange');
$lp1->SetCSIMTargets($targ1, $alts1);
$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');
开发者ID:JackPotte,项目名称:xtools,代码行数:31,代码来源:mulyaxiscsimex1.php

示例4: Graph

        $times[] = $timestamp;
        $drct[] = $thisDRCT;
        $mph[] = $thisMPH;
        $alti[] = $thisALTI;
    }
    $lts = $timestamp;
}
// End of while
include "../../../include/jpgraph/jpgraph.php";
include "../../../include/jpgraph/jpgraph_line.php";
include "../../../include/jpgraph/jpgraph_date.php";
include "../../../include/jpgraph/jpgraph_scatter.php";
// Create the graph. These two calls are always required
$graph = new Graph(640, 480);
$graph->SetScale('datlin', 0, 360);
$graph->SetYScale(0, 'lin', 0, 60);
$graph->SetYScale(1, 'lin');
$graph->SetColor("#f0f0f0");
$graph->img->SetMargin(55, 110, 55, 60);
$graph->title->Set("Polk City, Iowa SchoolNet Sub 1 Minute Time Series");
$graph->title->SetFont(FF_FONT1, FS_BOLD, 20);
$graph->xaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTitle("Times on the morning of 2 Oct 2007");
$graph->xaxis->SetTitleMargin(27);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD, 12);
$graph->xaxis->SetPos("min");
$graph->xaxis->SetLabelFormatString("h:i", true);
$graph->xaxis->scale->SetTimeAlign(MINADJ_1);
$graph->xaxis->SetLabelAngle(90);
$graph->yaxis->SetFont(FF_FONT1, FS_BOLD, 14);
$graph->yaxis->scale->ticks->Set(45, 15);
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:polk_bore.php

示例5: LinePlot

    $p2->SetColor('red');
    $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 {
开发者ID:jonsowman,项目名称:sgsweather-web,代码行数:31,代码来源:select_all.php


注:本文中的Graph::SetYScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。