jpgraph是php中一个非常非常强大的第三方报表工具,据说能完成一切你想要的图形…
新手初识jpgraph肯定会遇到各种各样的问题,比如乱码什么的,本案例是jpgraph3.0.7制作,也经过本人的多次实验,解决乱码问题
<?php
$datay=array(); //纵坐标数据
$datax=array(); //横坐标数据
foreach ($usernums as $key => $value){
$datay[] = $value;
$datax[] = $userids[$key];
}
require_once (‘jpgraph-3.0.7/jpgraph/jpgraph.php’);
require_once (‘jpgraph-3.0.7/jpgraph/jpgraph_bar.php’);
// Create the graph. These two calls are always required
$graph = new Graph(800,600); //图像高宽
$graph->SetScale(“textlin”);
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->xaxis->SetLabelAngle(30);
$graph->yaxis->scale->SetGrace(20);
$graph->xaxis->scale->SetGrace(20);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor(‘orange’);
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetAngle(45);
$bplot->value->SetFormat(‘%d’);
$graph->Add($bplot);
// Setup the titles
$graph->title->Set(iconv(“UTF-8″, “gb2312″,”用户消费报表图”));
$graph->xaxis->title->Set(iconv(“UTF-8″, “gb2312″,”用户姓名”));
$graph->yaxis->title->Set(iconv(“UTF-8″, “gb2312″,”用户订单数量”));
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
效果图:
<img title="php报表之jpgraph效果图" height="400" alt="" src="http://www.wfuyu.com/uploadfile/phpjc/www.52blogger.com/archives/539
波比源码 » php报表之jpgraph柱状图实例
levofloxacin 500mg usa levaquin drug
dutasteride generic cheap ondansetron 8mg order ondansetron without prescription
order generic spironolactone 100mg finasteride 5mg cost cost diflucan
ampicillin online buy erythromycin 250mg price brand erythromycin 250mg
generic sildenafil 100mg tamoxifen 20mg over the counter brand robaxin
order sildenafil 100mg pill estrace online order buy estradiol 1mg online
indocin 75mg uk cefixime 200mg price trimox us
buy tadalafil 20mg online help for ed order sildenafil sale
order anastrozole 1 mg generic Viagra mail order sildenafil canada
tadalafil 10mg gГ©nГ©rique acheter 25mg viagra viagra 200mg sans ordonnance
tadalafil kaufen für männer tadalafil 5mg für männer viagra 50mg generika
ramipril cost brand ramipril 5mg azelastine oral
catapres usa buy tiotropium bromide online cheap spiriva for sale online
buspirone ca buy buspar 10mg without prescription generic ditropan 2.5mg
hytrin 1mg tablet pioglitazone 15mg usa order sulfasalazine 500 mg generic
buy isosorbide sale cost lanoxin telmisartan cheap
zoloft cheap buy zoloft 50mg for sale buy sildenafil generic
order tadalafil 5mg sale Buy no rx cialis viagra 100mg pills for men
generic cialis 5mg buy amantadine 100mg pill symmetrel oral
naltrexone generic femara 2.5mg us cost aripiprazole 20mg
buy provigil 200mg for sale buy stromectol 12mg generic ivermectin 6 mg for humans for sale
luvox order online glucotrol order online buy generic glipizide
buy accutane 20mg sale order prednisone 5mg generic buy prednisone 20mg for sale
purchase piracetam pills piracetam 800mg tablet order sildenafil without prescription
azithromycin 250mg usa order prednisolone 10mg without prescription order gabapentin 600mg sale
sporanox for sale online buy itraconazole pill order tinidazole
buy olanzapine sale valsartan 160mg us diovan 80mg sale
viagra 100mg uk lisinopril medication brand lisinopril 10mg
metoprolol 100mg uk buy lopressor generic vardenafil 10mg ca
write essay service no deposit free spins casino play casino
order priligy 30mg online order priligy 60mg online cheap cheap levothyroxine pill
buy allopurinol pill order allopurinol 100mg online cheap ezetimibe 10mg pill
methotrexate 2.5mg oral warfarin 2mg generic purchase reglan online
buy domperidone generic buy motilium without prescription order flexeril
order ozobax pill buy generic tizanidine toradol for sale online
sumatriptan 25mg ca buy imitrex online purchase avodart for sale
ranitidine price buy generic zantac 300mg celecoxib 200mg ca
simvastatin usa proscar canada finasteride 1mg ca
buy generic diflucan 100mg cheap viagra without prescription viagra 150 mg
cephalexin 500mg tablet cephalexin 250mg cost order erythromycin generic
cefuroxime online order buy bimatoprost online generic robaxin