Page 1 of 1

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

Posted: Tue Nov 15, 2011 10:53 pm
by 8438623
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>

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

Posted: Thu Nov 17, 2011 12:28 pm
by yeray
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?

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

Posted: Thu Nov 17, 2011 4:36 pm
by 8438623
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.

addendum

Posted: Thu Nov 17, 2011 4:56 pm
by 8438623
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

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

Posted: Fri Nov 18, 2011 4:44 pm
by yeray
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.