Looking for example to send graph direct to browser

TeeChart for PHP
Post Reply
kragero60
Newbie
Newbie
Posts: 2
Joined: Thu Oct 21, 2010 12:00 am

Looking for example to send graph direct to browser

Post by kragero60 » Tue Jan 06, 2015 3:49 pm

The demos show a .png file being created. How do avoid that and send the graph to the browser without creating a .png file?

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Looking for example to send graph direct to browser

Post by Yeray » Wed Jan 07, 2015 9:32 am

Hello,

The charts in TeeChart PHP must be created at server-side but instead of creating a png as follows:

Code: Select all

$chart->render("chart1.png"); 
You can directly send the stream calling the same function without parameters:

Code: Select all

$chart->render();
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kragero60
Newbie
Newbie
Posts: 2
Joined: Thu Oct 21, 2010 12:00 am

Re: Looking for example to send graph direct to browser

Post by kragero60 » Wed Jan 07, 2015 2:08 pm

Hi,

Thanks for the reply. If I try that I get the following error message.

Fatal error: Call to undefined function imageftbbox() in /usr/local/uptime/GUI/teeChart/sources/GraphicsGD.php on line 2504

I need to have teeChart in a slightly unusual location... Do I have to do something special for that?

-Randy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Looking for example to send graph direct to browser

Post by Narcís » Thu Jan 22, 2015 9:33 am

Hello Randy,

Many apologies for the delayed reply.

Find attached an example calling render() without parameters and sending the chart to the browser as a stream. Hope this solves the problem at your end.
Attachments
demo_php_render_stream.zip
(946 Bytes) Downloaded 1850 times
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply