Search code examples
javascriptphplaravel-5teechart

Using TeeChart PHP with javascript


I'm trying to use TeeChart PHP. I use Laravel 5.1 framework on a Ubuntu 15.04 machine. So far, I've been able to include the librairy in Laravel. I put the TeeChartPHPOpen folder into vendor, added TChart.php in Composer.json -> autoload -> files, did run composer dumpautoload. Also, I did install the GD extension with sudo apt-get php5-gd and I did restart my web server (still on artisan).

I did some tests with the Steema's demos on http://www.steema.com/products/teechart/php/demos/Features/index.html. Here are my problems:

  1. With the example using JavaScript, Laravel flag me an error :

Call to undefined method ImageExport::getJavaScript()

I looked into the ImageExport file and don't find any trace of getJavaScript function.

  1. I did try another example that don't use this function (the Axes/Custom one). But now, there's a GD error thrown :

FatalErrorException in GraphicsGD.php line 1275: Call to undefined function imageantialias()

I can comment the imageantialias function lines (1275 and 1301) and then the example works. For now, it can do the trick but I really want to use the JavaScript asset and it be pleasant to have the anti-aliasing function too.

Any help is welcome! Thanks.


Solution

  • For the first Error, it was my mistake, didn't read through all the documentation for the free/trial version. JavaScript isn't available for this version.

    For the second one, I recompile PHP following this thread https://help.ubuntu.com/community/CompilingEasyHowTo

    The compilation configuration that worked for me was this one :

    ./configure  --prefix=/usr/
                  --with-apxs2=/usr/bin/apxs2
                  --with-config-file-path=/etc/php5/apache2
                  --disable-ipv6 --enable-inline-optimization
                  --disable-debug
                  --enable-bcmath
                  --enable-calendar
                  --with-curl --enable-ctype
                  --enable-discard-path
                  --enable-exif
                  --enable-ftp
                  --with-gd
                  --with-freetype-dir
                  --with-jpeg-dir
                  --with-png-dir
                  --enable-gd-native-ttf
                  --enable-magic-quotes
                  --enable-mbstring
                  --with-mcrypt --enable-soap --with-pear --with-xsl --with-zlib --with-openssl --enable-sockets --with-mysqli --enable-zip --with-tidy=/usr/ --with-bz2
    

    I'll just have buy the TeeChart to access the JavaScript translator.