Difference In Java & PHP Version

TeeChart for PHP
Post Reply
KingOfNice
Newbie
Newbie
Posts: 1
Joined: Wed Oct 01, 2008 12:00 am
Contact:

Difference In Java & PHP Version

Post by KingOfNice » Wed Nov 04, 2009 9:17 am

I am using TeeCHART for java version.
Because of performance, 4000 png image creation, considering TeeCHART for php version.

But java version erformance is more better than php version.

below is not solving. ( I am using trial version of TeeCHART of php version )

1. $tChart->getChart()->getExport()->getImage()->getPNG()->save($imagefilename);
-- is not executed.

2. $tChart->render($imagefilename);
-- executed but performance is very bad.

3. $tChart->getPanel()->getBrush()->loadImageFromFile($backgroundImageFileName);
-- is not executed.

4. (JAVA)
mParambottomAxis.getCustomLabels().clear();
AxisLabelItem mBarLabelItem = mParambottomAxis.getCustomLabels().add( ( mFileReadCnt - 1 - idx ) * 1.0, mTradeDt[idx].substring(6-1,6-1+5));

-- not convert into php version. how?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: Difference In Java & PHP Version

Post by Pep » Mon Nov 09, 2009 3:31 pm

Hello,

1) Which error does the code gives you? It's working fine using the following code :

Code: Select all

<?php
      //Includes
      require_once "../sources/TChart.php";
        
      // Assign Header text
      $chart1 = new TChart(400,250);
      $chart1->getHeader()->setText("PNG Export Demo");

      // Add Series to the Chart
      $points = new Points($chart1->getChart());
      $points->fillSampleValues(30);

      $chart1->render("chart1.png");
      $rand=rand();
      print '<font face="Verdana" size="2">PNG Export Format<p>';
      print '<img src="chart1.png?rand='.$rand.'"><p>';               

      $chart1->getChart()->getExport()->getImage()->getPNG()->save("c:\\TChart.png");
?>
2) What do you mean when you say "performance is very bad" ? Do you get same results as the online Features demo at :
http://www.steema.com/products/teechart ... index.html
?

3) You can find an example of this which is working fine at :
http://www.steema.com/products/teechart ... index.html
under : Miscellanous\Back image Load (it also included into the Features demo, into the zipped file)
Does it works fine for you ?

4) With the PHP version there's two ways to acomplish it :
- One by using the OnGetAxisLabel event : You can find one example into the Features demo (under Axes\OnGetAxesLabelEvent.php).
- Setting the custom Axis labels directly, using similar code to the JAVA version. You should be able to do it by using :

Code: Select all

$chart->getChart()->getAxes()->getBottom()->getLabels()->getItems()->clear();
$chart->getChart()->getAxes()->getBottom()->getLabels()->setStyle(AxisLabelStyle::$TEXT);
$chart->getChart()->getAxes()->getBottom()->getLabels()->getItems()->add(0,"mylabel");
Please do not hesitate to contact us if you still having problems.

Post Reply