⑴ php 折线图怎么添加一条平行于X轴的直线
1.打开Excel后,新建一个数据表,然后点击【插入】面板上的图表图标,生成一个柱形图。2..添加横向参考线有两种方法,第一种是直接绘制线条来添加。点击选中图表,然后点击插入菜单中的形状下的线条图形,按住键盘Shift键,按住鼠标左键拖拉绘制。绘制号以后,可以通过调整右侧面板属性的颜色,透明度等参数来设置参考线的风格。这种方式存在一个缺点,就是参考线不够精确,所以对于需要精确数据的表格来说不推荐使用此种方法
⑵ 那位高人能告诉小女在用php GD库做验证码的时候怎样加入干扰线啊,注意不是直线啊,是那种曲线啊
这段代码你可以看看,自己原创的哦,
<?php
$im = ImageCreate(200,200);
$red = ImageColorAllocate($im,0xFF,0x00,0x00);
$black = ImageColorAllocate($im,0x00,0x00,0x00);
$white = ImageColorAllocate($im,0xFF,0xFF,0xFF);
$ys1 = ImageColorAllocate($im,0xE9,0xB1,0x50);
$ys2 = ImageColorAllocate($im,0x98,0x25,0xCB);
$ys3 = ImageColorAllocate($im,0x40,0x88,0x47);
ImageFilledRectangle($im,50,50,150,150,$black);
//点
for($i=0;$i<300;$i++){
ImageSetPixel($im,rand(1,200),rand(1,200),$white);
}
//虚线
for($i=0;$i<10;$i++){
ImageDashedLine($im,rand(1,200),rand(1,200),rand(1,200),rand(1,200),$ys1);
}
//线
for($i=0;$i<10;$i++){
ImageLine($im,rand(1,200),rand(1,200),rand(1,200),rand(1,200),$ys1);
}
//矩形框
for($i=0;$i<3;$i++){
ImageRectangle($im,rand(1,200),rand(1,200),rand(1,200),rand(1,200),$ys1);
}
//矩形面
for($i=0;$i<2;$i++){
ImageFilledRectangle($im,rand(1,200),rand(1,200),rand(1,200),rand(1,200),$ys1);
}
//多边形
$point = array(rand(1,200),rand(1,200),rand(1,200),rand(1,200),rand(1,200),rand(1,200));
ImagePolygon($im,$point,count($point)/2,$ys2);
ImageFilledPolygon($im,$point,count($point)/2,$ys2);
//弧线
ImageArc($im,rand(20,180),rand(20,180),rand(50,150),rand(50,150),rand(0,360),rand(0,360),$ys3);
//打字
ImageString($im,4,20,30,"add word",$ys3);
//ImageTTFText($im,30,0,rand(0,50),rand(30,200),$ys3,'msyhbd.ttf',"添加文字");
header('Content-Type:image/png');
ImagePNG($im);
?>