⑴ 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);
?>