InfoQ

交流

讨论:还是jpgraph的问题:怎么把数组传给作图程序

作者 xiaobinB 发布于 2003-08-01 分类:php基础编程

假设我的主程序是main.php,我获得了需要作图的数组$ydata=array(); 然后调用graph.php,在网页中插入动态图片(网页中还有其他内容)。程序是。问题是,怎么把数组$ydata传给graph.php呢?或者还有其他方法实现么?

我的问题清楚么?

假定graph.php用jpgraph的例子:
<?php
include ( "jpgraph/src/jpgraph.php");
include ("jpgraph/src/jpgraph_line.php");


// Some data
//这里是需要做图的数组,需要从main.php传过来
//$ydata = array(11,3, 8,12,5 ,1,9, 13,5,7 );

// Create the graph. These two calls are always required
$graph = new Graph(560, 360,"auto");
$graph->SetScale( "textlin");

// Create the linear plot
$lineplot =new LinePlot($ydata);
$lineplot ->SetColor("blue");

// Add the plot to the graph
$graph->Add( $lineplot);

// Display the graph
$graph->Stroke();

?>



逛论坛交流还是jpgraph的问题:怎么把数组传给作图程序

加入书签
digg+,
reddit+,
del.icio.us+,
dzone+

0 条回复

回复




  1. 我有话要讲:(可以匿名发表, 发广告的有多远请滚多远!!!)

    昵称: 请输入验证码:


抢着回答

belltree哥,顺便再问你一个问题

在PHP中如何用JOIN语句?? 我好象记得在PHP中不时用JOIN标记的,...

庾澄庆 恰似你的温柔

:crying: :crying: :crying: :crying: 帮我找下哪里有可下的m...

这里有php学习文章。

www.flash8.com.cn

关于mysql 数据库的问题

Most databases do, and MySQL InnoDB tables do, but MySQL MyI...

我做的留言本,请大家指点一下!

*----------------------------------------------- 留言本程...

谈谈phpx论坛的重要性~~

谈谈PHPX论坛的重要性~~ 我觉得在这里我能够解决我的问题,我希...

Mysql中10除以0的小问题,大家帮帮我

update test set test=23/0 返回:#1105 - Unknown error 请...

请高手帮我找一下错,我头都晕了,多谢!!

<? include"cart.php"; session_start(); //省略掉前面...

session 告急!!!

两个程序: test.php 内容如下: <? session_s...

刘铭大哥~~~~~~~

小弟想知道您本人的样子也象你的头像那样子吗?--------胖胖的、...

[]