使用Ajax与Jpgraph怎么实现一个动态折线图功能-创新互联
今天就跟大家聊聊有关使用Ajax与Jpgraph怎么实现一个动态折线图功能,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

具体如下:
一 代码
fun.js:
var i=1;
function progress(){
setInterval("beginProgress()", 600);
}
function beginProgress(){
$("#img").attr("src", "img.php?m="+i);
i++;
if(i>=12){
i=1;
}
}index.php:
Ajax+Jpgraph制作动态折线图 ![]()
img.php:
SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40, 30, 30, 70);
$graph->title->Set("图书销售走势表");
$lineplot1 = new LinePlot($data1);
$graph->Add($lineplot1);
$graph->xaxis->title->Set("月份");
$graph->yaxis->title->Set("book A销售金额(万元)");
$graph->title->SetFont(FF_SIMSUN, FS_BOLD);
$graph->yaxis->title->SetFont(FF_SIMSUN, FS_BOLD);
$graph->xaxis->title->SetFont(FF_SIMSUN, FS_BOLD);
$lineplot1->SetColor('red');
$lineplot1->SetLegend('book A');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.4, 0.95, 'center', 'bottom');
$graph->Stroke();二 运行结果

看完上述内容,你们对使用Ajax与Jpgraph怎么实现一个动态折线图功能有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。
当前标题:使用Ajax与Jpgraph怎么实现一个动态折线图功能-创新互联
本文地址:http://www.jxjierui.cn/article/phdod.html


咨询
建站咨询
