pChart 2.x forum
http://wiki.pchart.net/forum/

output graphs in loop
http://wiki.pchart.net/forum/viewtopic.php?f=3&t=2129
Page 1 of 1

Author:  arabon [ Tue Aug 09, 2011 2:25 am ]
Post subject:  output graphs in loop

Hi, guys!

I have got a problem. I tried to output graphs in loop, but only the first graph is outputted.
How to solve my problem? =)
Code:
for ($i=0;$i<count($arr);$i++)
{
$MyData = new pData();
...

$myPicture->autoOutput("pictures/google_get".$poss_bd[$i].".png");
}

Author:  jean-damien [ Tue Aug 09, 2011 7:03 am ]
Post subject:  Re: output graphs in loop

Hi,

Is this script called from a web browser or a server command line?

JD.

Author:  arabon [ Tue Aug 09, 2011 12:07 pm ]
Post subject:  Re: output graphs in loop

a server command line

Author:  jean-damien [ Tue Aug 09, 2011 12:32 pm ]
Post subject:  Re: output graphs in loop

First I would advice to use the render() function to create the files (but it will not solve the issue):

Code:
$myPicture->render("pictures/google_get".$poss_bd[$i].".png");


Then you must ensure that your script isn't stuck anywhere and that the file name really change by adding some echos. There is no limitation on the number of charts generated by a script files. (I'm using a daemonized PHP script that generate hundred of pictures)

JD.

Author:  arabon [ Tue Aug 09, 2011 1:29 pm ]
Post subject:  Re: output graphs in loop

Yeah :D It works.
Thanks a lot =)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/