DSobolewski

Long Waiting Time For Display

Recommended Posts

Hello dev and member. Sorry for my bad english.

The following short script that displays the columns in different colors:

 

<?php
$starttime = microtime(true);
$now = gmdate("D, d M Y H:i:s") . ' GMT';
header ('Date: '.$now);
header ('Expires: '.$now);
header ('Last-Modified: '.$now);
header ('Pragma: no-cache');
header ('Cache-Control: no-store, no-cache, max-age=0, must-revalidate');

include('../libFC/FusionCharts_Gen.php');

$FC = new FusionCharts('ScrollColumn2D',800,400);
$FC->setSWFPath('../libFC/Charts/');
$FC->setInitParam('debugMode',false);
$FC->setParamDelimiter('

);

$tab_alpha = array(100, 90, 80, 70, 60, 50, 40);
$tab_kolory = array();
for ($cr = 0; $cr < 256; $cr += 51) {
for ($cg = 0; $cg < 256; $cg += 51) {
   	for ($cb = 0; $cb < 256; $cb += 51) {
       	$tab_kolory[] = strtoupper( sprintf( '%02s%02s%02s', dechex($cr), dechex($cg), dechex($cb) ) );
   	}
}
}

	$tablica = $tab_kolory;
	$cyfra = 1000;
	$ilosc = count($tablica);

   	for ($ia = 0; $ia < $ilosc_alpha; $ia++) {
       	$na = $cyfra + ($ia * $cyfra);
       	for ($ic = 0; $ic < $ilosc; $ic++) {
           	$FC->addCategory($na + $ic);
       	}
   	}

   	for ($ia = 0; $ia < $ilosc_alpha; $ia++) {
       	$na = $cyfra + ($ia * $cyfra);
       	for ($ic = 0; $ic < $ilosc; $ic++) {
           	$FC->addChartData(72.34,'label='.($na + $ic).'$toolText=Kolor: '.$tablica[$ic].' Alpha: '.$tab_alpha[$ia].'$color='.$tablica[$ic].'$alpha='.$tab_alpha[$ ia].'

);
       	}
   	}

$FC->renderChart(true);

$stoptime = microtime(true);
$total=round($stoptime-$starttime,5);
echo 'Time: '.$total.' sec';
?>

php script execution time: 0.15661 sec - good :rolleyes:

 

Problem: time display in the browser: 11 sec !!!!! and browser it's blocked 5 sec.

 

The screen stays white and does not show up any words such as "rendering continues". It could use a progress bar.

How to overcome the problem of long waiting times so you see the chart?

 

Computer CoreDuo 2.66, 4GB RAM, Windows7, IE or FF (browser).

 

Best Regards

Edited by DSobolewski

Share this post


Link to post
Share on other sites

Hi,

 

Please note that in order to render the chart timely, you would need to disable or keep the minimum required attributed related to alpha, tooltip, shadow and styles on the chart.

 

Hope this helps. :rolleyes:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now