Page 1 of 1

Max image width?

Posted: Sun May 05, 2013 5:58 pm
by 15965760
It seems that specifying an image width greater than 5800px results in GD memory crash. Wide images are necessary for scrolling very long line graphs with thousands of data points and an x axis running from zero to over 40,000 (feet).

a) Is TeeChart restricting image width?
b) If so, can that be increased?

Re: Max image width?

Posted: Thu May 09, 2013 9:53 am
by yeray

Please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Also, pleas specify what exact TeeChart build are you using.

Thanks in advance.
rustydiver wrote:a) Is TeeChart restricting image width?
b) If so, can that be increased?
We could increase the memory allocate but we'd like to study alternatives if we could get the example mentioned above.

Re: Max image width?

Posted: Thu May 09, 2013 1:49 pm
by 15965760
This is the version..

Release Notes Notes 16th Nov 2012
Build 2012.10.08.001

Code below is straight from your examples at demos/Features Chart Styles>Standard>Line 2D. I can make the image up to about 6050x600 px, at 6100x600 px it will error out with this..

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24400 bytes) in C:\xampp\htdocs\CPDT\CPDT\charts\sources\GraphicsGD.php on line 587

Code: Select all

$chart = new TChart(6100,600);
$chart->getHeader()->setText("2D Line Chart");



$line1=new Line($chart->getChart());  
$data = Array(10,50,25,175,125,200,175);

$line2=new Line($chart->getChart());  

/* You can also use one of the following methods , in the case you want to 
specify a text or color for each point :


$line3=new Line($chart->getChart());  
$data = Array(200,175,175,100,65,110,90);

foreach ($chart->getSeries() as $serie) {
  $pointer = $serie->getPointer();
  $marks = $serie->getMarks();



print '<font face="Verdana" size="2">Line 2D Style<p>';
print '<img src="chart1.png?rand='.$rand.'">';
My actual code has more information and much greater y and x values, but the image size restriction is still pretty close to the same as your simple example chart. So it is not an issue of stretching the x axis or anything. As stated previously, if you have an x axis in feet running 8 miles or more and y values every 5 feet or so, you need a good image width to scroll for any detail or you are just looking at a scrunched accordian.

If you change the class file from imagecreatetruecolor to just imagecreate, you can get a little bit wider, but other things like color in any band coloring may go to gray, etc.

Re: Max image width?

Posted: Fri May 10, 2013 4:52 am
by 15965760
An increase to 128M in TChart.php will yield 10,000x600 px (far as I tested to because that is about what I need). I'll let you know if it catches fire.

Re: Max image width?

Posted: Thu May 23, 2013 2:55 pm
by Pep

related with the other post. I'll back with fixed sources.