Page 1 of 1

undefined method TChartObj::readJSWrapperHiddenFieldName()

Posted: Thu Apr 30, 2009 4:11 am
by 13052870
I have TeeChart for PHP Source and installed it according to instructions. I'm using Delphi for PHP v.1 on Vista (I have same problem on XP). I start a New Application and put TChartObj on form and Run and I can't get beyond this error message:

"Fatal error: Call to undefined method TChartObj::readJSWrapperHiddenFieldName() in C:\Program Files (x86)\CodeGear\Delphi for PHP\1.0\vcl\tchart.inc.php on line 97"

Do you know what the problem is?

Thanks in advance,
Don

Posted: Thu Apr 30, 2009 2:14 pm
by Pep
Hi Don,

it's strange, I've done some tests here with Delphi for PHP v2 and worked fine. I think it should work fine with the v1. I'm going to check again with the Delphi for PHP v1. I'll back to you asap.

Does it works creating the TChart object directly at runtime through code ?

Code: Select all

       use_unit("tchart.inc.php");

       public $c= null;
       function Unit11Create($sender, $params)
       {
            $this->c = new TChart(500,300);
            // Graphic component that dumps binary data
            header("Content-type: image/png");

            // Tries to prevent the browser from caching the image
            header("Pragma: no-cache");
            header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
            header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
            $this->c->render();
       }

Delphi for PHP v1 and TeeChart for PHP

Posted: Thu Apr 30, 2009 3:23 pm
by 13052870
This code works runtime in Delphi for PHP v1, from FastLineChart.php Standard examples (all the others work, too). But I want to use TChartObj as component on Delphi form with other components:

<?php
//Includes
include "../../../../sources/TChart.php";

if(isset($_POST["stairs"]))
$stairs = $_POST["stairs"];
if(isset($_POST["invstairs"]))
$invstairs = $_POST["invstairs"];
if(isset($_POST["ignorenulls"]))
$ignorenulls = $_POST["ignorenulls"];

$chart1 = new TChart(500,250);
$chart1->getChart()->getHeader()->setText("FastLine Style");
$chart1->getChart()->getAspect()->setView3D(false);
$chart1->getChart()->getAxes()->getLeft()->getMinorGrid()->setVisible(false);
$chart1->getChart()->getAxes()->getBottom()->getMinorGrid()->setVisible(false);

// Add FastLine Series
$fastLine=new FastLine($chart1->getChart());
$fastLine->setColor(new Color(250,72,52));

/* Adding data from Array */
$yValues = Array();
for ($i=0;$i<100;$i++)
$yValues[]=rand(0,1000);

$fastLine->addArray($yValues);

// Set some nulls
$fastLine->setNull(13);
$fastLine->setNull(25);
$fastLine->setNull(40);

// Changes Stairs mode
$fastLine->setStairs(isset($stairs));
// Inverted Stairs
if (isset($invstairs))
$fastLine->setStairs(true);

$fastLine->setInvertedStairs(isset($invstairs));
// FastLine Ignore Nulls
$fastLine->setIgnoreNulls(isset($ignorenulls));

$chart1->render("chart1.png");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Line Charts</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
</head>
<body>
<font face="Verdana" size="2">FastLine Series, allows to populate data using Arrays<p>
<img alt="FastLine Chart" src="chart1.png" style="border: 1px solid gray;"/></p>
<form method="post" action="<?php echo $PHP_SELF;?>">
Stairs Mode: <input type="checkbox" name="stairs" value="stairs" /><br />
Inverted Stairs: <input type="checkbox" name="invstairs" value="invstairs" /><br />
Ignore Nulls: <input type="checkbox" name="ignorenulls" value="ignorenulls" /><br /><br />
<input type="submit" value="Refresh !">
</form>
</font>
</body>
</html>

TeeChart for PHP sources

Posted: Thu Apr 30, 2009 3:27 pm
by 13052870
I have TeeChart for PHP sourcecode and installed exactly as directed, which simply copied files to ...vcl/ . Shouldn't there be a step where it is compiled and put in a ".lib" or ".dll" which is then used?

Posted: Thu May 07, 2009 9:08 am
by Pep
Hi,
I have TeeChart for PHP sourcecode and installed exactly as directed, which simply copied files to ...vcl/ . Shouldn't there be a step where it is compiled and put in a ".lib" or ".dll" which is then used?
No it isn't , you only have to create a new folder named "teechart" into the \vcl folder and then copy the "sources" folder there (i.e : c:\program files\codegear\delphi for php\1.0\vcl\teechart\sources\....". then copy the tchart.inc.php and tchart.ide.inc.php into the \vcl folder.
Once this has been done you can add the "c:\Program Files\CodeGear\Delphi for PHP\1.0\vcl\teechart\sources\TeeChart.package.php" as a new component through the component list and be able to palce a tChart object into the form designer.
I've been doing some tests here with the :
"Delphi® for PHP Version 1.0.5.695 Copyright © 2007 CodeGear. All Rights Reserved."
and worked fine.

Hooray for TeeChart for PHP and Delphi for PHP v.2!

Posted: Thu May 07, 2009 11:21 am
by 13052870
Thanks, Josep. I did install like that (as described in "install.txt) and had the problems I described. I couldn't believe I was the only one on this planet who was having those troubles, so I took the next step in debugging this/my problem and purchased the upgrade to Delphi for PHP v.2, then went through the rigamarole to uninstall it and then download and install the v.2 service pack 2. Then I copied the ..\teechart directory with the source, etc., that I had had in my Delphi for PHP v.1 \vcl directory to the new v.2 \vcl directory, along with the two ".inc" files, installed the TeeChart package file--and it worked! I was up past midnight loading and running the demo programs. So it seems--and I hope--I'm in business. Since I used the exact same TeeChart for PHP files and put them in the same place in v.2, I can only assume my problem was somehow in the Delphi for PHP v.1 setup, I have no idea exactly what it was, I don't want to go back, I just want to go forward and get to work on my project. (Now all I have to do is learn PHP.) And thanks again for TeeChart Support Forum! :)
Don Ridgway

Posted: Thu May 07, 2009 2:28 pm
by Pep
Hi Don,

ok I'm glad to hear that all is working now. Don't hesitate to contact us if we can be of any further help.
We'll post a new maintenance release of TeeChart for PHP (at the private customers download page) in a few days. This include some fixes, speed improvements, and some more features (series styles, tools, transparency support on objects, etc..).
We'll inform about the upload at this forum.