首页 > 其他 > 详细

pchart生成折线图

时间:2019-10-24 17:56:21      阅读:199      评论:0      收藏:0      [点我收藏+]
include("statics/pChart/pData.class");  
    include("statics/pChart/pChart.class");  // Dataset definition
    $DataSet = new pData;
    $DataSet->AddPoint($num,"Serie1");//反馈人数
    $DataSet->AddPoint($feed,"Serie2");//反馈量
    $DataSet->AddPoint($tim,"Serie3");//x轴时间
    $DataSet->AddSerie("Serie1");
    $DataSet->AddSerie("Serie2");
    $DataSet->SetAbsciseLabelSerie("Serie3");// Initialise the graph   
    $Test = new pChart(1050,345);
    $Test->setFontProperties("statics/Fonts/tahoma.ttf",8);
    $Test->setGraphArea(85,30,975,300);
    $Test->drawFilledRoundedRectangle(7,7,1040,335,5,240,240,240);
    $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
    $Test->drawGraphArea(255,255,255,TRUE);
    $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
    $Test->drawGrid(4,TRUE,230,230,230,50);
    $Test->setFontProperties("statics/Fonts/tahoma.ttf",6);
    $Test->drawTreshold(0,143,55,72,TRUE,TRUE);
    $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
    $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
    $imageFile = "uploadfile/zhexian/1.png";
    $Test->Render($imageFile);
    echo ‘<img src="‘.$imageFile.‘">‘;

pchart类库下载(地址:http://pchart.sourceforge.net/documentation.php)

pchart生成折线图

原文:https://www.cnblogs.com/zinging/p/11733669.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!