临时

public function testAction(){
            $this->noRender();
            include "jpgraph.php";
            include "jpgraph_line.php";
            include "jpgraph_scatter.php";
            include "jpgraph_regstat.php";
            
            // Original data points
            $xdata = array(1,2,3,4,5,6);
            $ydata = array(5,1,9,6,4,1);
            
            //$xdata1 = array(1,2,4,6,7,9);
            $ydata1 = array(5,1,6,1,5,9);
            $x_tick_label = array('2007-1','2007-2','2007-3','2007-4','2007-5','2007-6');
            $spline = new Spline($xdata,$ydata);
            $spline1 = new Spline($xdata,$ydata1);
            
            
            // For the new data set we want 40 points to
            // get a smooth curve.
            list($newx,$newy) = $spline->Get(50);//曲线的光滑度,50流畅
            list($newx1,$newy1) = $spline1->Get(50);
            // Create the graph
            $g = new Graph(555,310);
            $g->SetMargin(30,30,40,30);
            $g->legend->Hide(false);
            $g->title->Set("2007年2月2日净值情况");
            $g->title->SetFont(FF_SIMSUN,FS_NORMAL,12);
            $g->subtitle->Set('(华夏成长 (000001)基金净值)');
            $g->subtitle->SetFont(FF_SIMSUN,FS_NORMAL,9);
            $g->subtitle->SetColor('darkred');
            $g->SetMarginColor('white');
            $g->SetScale('linlin');
            $g->xaxis->SetTextLabelInterval(2);//LABLE会重复出现一次,这里使用2为间隔,使多余的LABEL不显示
            $g->xaxis->SetTickLabels($x_tick_label);
            $g->xgrid->Show(true);
            $g->xaxis->SetTextTickInterval(0,0);
            //$g->xaxis->SetPos('min'); //轴位置
            $g->xaxis->SetColor('#94BDE2','black'); 
            //$g->xaxis->Setlabelmargin(10); 标签和轴间距
            // We use a scatterplot to illustrate the original
            // contro points.
            $splot = new ScatterPlot($ydata,$xdata); //原点
            $splot->mark->SetFillColor('red@0.3');
            $splot->mark->SetColor('red@0.5');
            
            
            $splot1 = new ScatterPlot($ydata1,$xdata); //原点
            $splot1->mark->SetFillColor('blue@0.3');
            $splot1->mark->SetColor('blue@0.5');
            
            // And a line plot to stroke the smooth curve we got
            // from the original control points
            $lplot = new LinePlot($newy,$newx); //创建曲线
            $lplot1 = new LinePlot($newy1,$newx1);
            $lplot->SetColor('#94BDE2');
            $lplot1->SetColor('red');
            
            // Add the plots to the graph and stroke
            $g->Add($lplot);
            $g->Add($lplot1);
            $g->Add($splot);
            $g->Add($splot1);
            $g->Stroke();
        }
此条目发表在 未分类 分类目录,贴了 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>