I can't render the simplest of graphs in Teechart for PHP

TeeChart for PHP
Post Reply
hakelm
Newbie
Newbie
Posts: 3
Joined: Fri Nov 15, 2002 12:00 am

I can't render the simplest of graphs in Teechart for PHP

Post by hakelm » Tue Nov 15, 2011 10:53 pm

Trying to get started with Teechart for PHP, downloaded today, I immediately run into problems.
None of the exmples works and the short PHP-code below crashes. Commenting out the rendering line lets the program survive, but no graph.
That I have the proper file-permissions is demonstrated by the line that is commented works when uncommented.
What do I do wrong?
Thanks in advance for any tip.
Håkan


<?php
require_once "../teechart/sources/libTeeChart.php";
$tchart = new TChart(500,300);
#shell_exec ( "touch tchart.png" );
$tchart->render("tchart.png");
?>
Now, some html lines are required to display the image at the same page :
<body>
<img alt="bug" src="tchart.png" style="border: 0px solid gray;"/>
</body>

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

Re: I can't render the simplest of graphs in Teechart for PHP

Post by Yeray » Thu Nov 17, 2011 12:28 pm

Hello Håkan,

Your code works fine for me here with EasyPHP 5.3.8.1. I only had to change the path for the libTeeChart.php to fit my configuration.
Have you tried with EasyPHP or another machine?
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

hakelm
Newbie
Newbie
Posts: 3
Joined: Fri Nov 15, 2002 12:00 am

Re: I can't render the simplest of graphs in Teechart for PHP

Post by hakelm » Thu Nov 17, 2011 4:36 pm

My problem seems to be with the ubuntu distribution of GD, several functions utilised by Teechart are missing.
After downloading and installing PHP 5.3.8 with the following:
./configure --with-mysql --with-gd --with-jpeg-dir --enable-gd-native-ttf --with-png-dir --with-freetype-dir
I can get the script working with the php command line client but Apache2 gives me the following message:
Fatal error: Call to undefined function imagecreatetruecolor() in /var/www/teechart/sources/GraphicsGD.php on line 1012
(after restart and including
ini_set('display_errors', 'On');
error_reporting(E_ALL);
in the script).
So now I think it has to do with my Apache settings. Any tip? My phpinfo is attached.
Håkan
Ps When your program doesn't work out of the box with at least one of the major distributions I guess it would be wise to be a bit more detailled in your installation instructions.
Attachments
phpinfo().rar
(7.87 KiB) Downloaded 2338 times

hakelm
Newbie
Newbie
Posts: 3
Joined: Fri Nov 15, 2002 12:00 am

addendum

Post by hakelm » Thu Nov 17, 2011 4:56 pm

root@hemmasex:/var/www/teechart/demos/PHPDemos# php demo1.php

Fatal error: Call to undefined function bccomp() in /var/www/teechart/sources/styles/Series.php on line 3607

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

Re: I can't render the simplest of graphs in Teechart for PHP

Post by Yeray » Fri Nov 18, 2011 4:44 pm

Hello,

I also found the problem with imagecreatetruecolor some time ago. Find here the instructions I wrote:
http://www.teechart.net/support/viewtop ... etruecolor

If you still find problems with it, please don't hesitate to let us know.
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

Post Reply