我用jpgraph生成画布,输入画布,但是把图片不能保存成功,运行程序也没有错误提示。
//用php画折线图
include(e:/phpser/appserv/jpgraph/jpgraph/jpgraph.php);
include(e:/phpser/appserv/jpgraph/jpgraph/jpgraph_line.php);
$datay=$pm25;
$graph = new graph(700,300,auto); //生成画布
$graph->img->setmargin(50,40,30,40); //设置画布的边距
$graph->img->setantialiasing(); //设置拆线的平滑状态
$graph->setscale(textlin); //设置刻度样式
$graph->setshadow();//创建画布阴影
$graph->title->set(最近24小时pm2.5值的变化);//设置标题
$graph->title->setfont(ff_simsun,fs_bold);//设置标题字体
$graph->setmargincolor(lightblue);//设置画布的背景颜色为淡蓝色
$graph->yaxis->title->setfont(ff_simsun,fs_bold);//设置y轴标题的字体
$graph->xaxis->setpos(min);
$graph->yaxis->hidezerolabel();
$graph->ygrid->setfill(true,[email protected]',[email protected]');
$graph->xaxis->setticklabels($a);
$graph->xaxis->setfont(ff_simsun); //设置x坐标轴的字体
$graph->yscale->setgrace(20);
$p1 = new lineplot($datay); //创建折线图对象
$p1->mark->settype(mark_filledcircle); //设置数据坐标点为图形标记
$p1->mark->setfillcolor(red); //设置填充的颜色
$p1->mark->setwidth(4); //设置圆柱形标记的直径为4像素
$p1->mark->setcolor(blue); //设置拆线颜色为蓝色
$p1->setcenter(); //在x轴的各坐标点中心位置绘制拆线
[color=#ff0000]$graph->add($p1); //在统计图上绘制折线
//$graph->stroke(); //输出图像
$graph->stroke('c:/appserv/www/pm25/1.jpg);
------解决思路----------------------
你
$graph->stroke(); //输出图像
时有图片显示吗?
------解决思路----------------------
不懂啊,在学习,加油吧!!
------解决思路----------------------
有什么错误提示?
保存图片的路径是否可写?
------解决思路----------------------
不报错,不等于没有错
你只能跟踪进去看看是什么地方出了问题