SeeThePicture

Loading Chart. Please Wait.

Recommended Posts

Hi,

 

I'm using Chrome 19.0.1084.46 m.

 

I have a local apache server and MYSQL database set up on my laptop. I successfully interface with the db via php to get info, create XML data and generate flash charts. So far everything

 

works fine with my Fusioncharts XT when viewing flash charts on my local laptop http://localhost.

 

However I want to make a change. I want to set up my local system to never generate flash charts. I want to generate only Fusionchart JavaScript charts. When I tried the example "Explicitly

 

render JavaScript only charts" everything worked fine via my http://localhost.

 

Then I tried to substitute my actual links into the code by doing this:

 

replace:

var myChart = new FusionCharts( "FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" ); with

var myChart = new FusionCharts( "FusionCharts/MSCombi2D.swf", "myChartId", "400", "300", "0", "1" );

 

replace:

myChart.setXMLUrl("Data.xml"); with

myChart.setXMLUrl("mscombi2D.xml");

 

where mscombi2D.xml is a xml file for multi series charts saved in the same directory as my index.php. and

where my directories are set up with my swf files residing in a folder in public_html\FusionCharts.

 

The first thing I observe is that a 400px by 300px area appears, as though I am about to be shown a beautiful Fusioncharts Javascript chart. Then I get this message:

 

"Loading Chart. Please wait." -----> And that's all. It stops there. :-(

 

Here are some examples of what I've tried:

-- playing with the paths

-- Adding "../" as in "../FusionCharts/MSCombi2D.swf..."

-- Adding "../" as in "../mscombi2D.xml..."

-- Try a known good xml file

-- replaced mscombi2D.xml with tryDataFromXmlGenerator.xml where tryDataFromXmlGenerator.xml was a xml file created with FC's XML Generator utility.

-- went to chrome://plugins/ and made sure "Flash (2) files" was disabled.

 

I've tried and undone each of the above three things one at a time, but all produce the same result. No improvement. (same message. "Loading Chart. Please Wait.").

 

Please advise.

 

Thank You,

SeeThePicture

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

I'm using Chrome 19.0.1084.46 m.

 

I have a local apache server and MYSQL database set up on my laptop. I successfully interface with the db via php to get info, create XML data and generate flash charts. So far everything

 

works fine with my Fusioncharts XT when viewing flash charts on my local laptop http://localhost.

 

However I want to make a change. I want to set up my local system to never generate flash charts. I want to generate only Fusionchart JavaScript charts. When I tried the example "Explicitly

 

render JavaScript only charts" everything worked fine via my http://localhost.

 

Then I tried to substitute my actual links into the code by doing this:

 

replace:

var myChart = new FusionCharts( "FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" ); with

var myChart = new FusionCharts( "FusionCharts/MSCombi2D.swf", "myChartId", "400", "300", "0", "1" );

 

replace:

myChart.setXMLUrl("Data.xml"); with

myChart.setXMLUrl("mscombi2D.xml");

 

where mscombi2D.xml is a xml file for multi series charts saved in the same directory as my index.php. and

where my directories are set up with my swf files residing in a folder in public_html\FusionCharts.

 

The first thing I observe is that a 400px by 300px area appears, as though I am about to be shown a beautiful Fusioncharts Javascript chart. Then I get this message:

 

"Loading Chart. Please wait." -----> And that's all. It stops there. :-(

 

Here are some examples of what I've tried:

-- playing with the paths

-- Adding "../" as in "../FusionCharts/MSCombi2D.swf..."

-- Adding "../" as in "../mscombi2D.xml..."

-- Try a known good xml file

-- replaced mscombi2D.xml with tryDataFromXmlGenerator.xml where tryDataFromXmlGenerator.xml was a xml file created with FC's XML Generator utility.

-- went to chrome://plugins/ and made sure "Flash (2) files" was disabled.

 

I've tried and undone each of the above three things one at a time, but all produce the same result. No improvement. (same message. "Loading Chart. Please Wait.").

 

Please advise.

 

Thank You,

SeeThePicture

 

 

Hi,

 

Can you paste your sample code and XML code here?

 

It would be helpful to look into it.

 

 

Share this post


Link to post
Share on other sites

Here is my sample code:

        <div id="chartContainer">FusionCharts will load here!</div>
             <script type="text/javascript">
                 FusionCharts.setCurrentRenderer('javascript');
                 var myChart = new FusionCharts( "FusionCharts/MSCombi2D.swf", "myChartId", "400", "300", "0", "1" );
                 myChart.setXMLUrl("tryDataFromXmlGenerator.xml");
                 myChart.render("chartContainer");
             </script>

 

Here is my sample XML (tryDataFromXmlGenerator.xml):

<chart caption="caption here" subcaption="subcaption here" xaxisname="myXaxis" yaxisname="myYaxis" palette="1">
<categories>
	<category label="5/1/2012" />
	<category label="5/2/2012" />
	<category label="5/3/2012" />
	<category label="5/4/2012" />
	<category label="5/5/2012" />
	<category label="5/6/2012" />
	<category label="5/7/2012" />
	<category label="5/8/2012" />
	<category label="5/9/2012" />
	<category label="5/10/2012" />
	<category label="5/11/2012" />
	<category label="5/12/2012" />
	<category label="5/13/2012" />
	<category label="5/14/2012" />
	<category label="5/15/2012" />
	<category label="5/16/2012" />
	<category label="5/17/2012" />
	<category label="5/18/2012" />
	<category label="5/19/2012" />
	<category label="5/20/2012" />
</categories>
<dataset SeriesName="Series_1">
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
	<set value="1200" />
</dataset>
<dataset SeriesName="Series_2">
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
	<set value="2000" />
</dataset>
<dataset SeriesName="Series_3">
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
	<set value="3000" />
</dataset>
</chart>

Share this post


Link to post
Share on other sites

For what it's worth, I have identified one line of code -- the presence and absence of which instantly toggles me between two states.

 

FusionCharts.setCurrentRenderer('javascript');

 

When I have it in place I expect to see a Javascript chart but instead all I get is "Loading Chart. Please wait."

When I delete it, I do get a functioning Flash chart. But, as you can read from my original post that's not what I want.

 

Have I done something to cause the "FusionCharts.setCurrentRenderer('javascript')" to stop working? Please advise.

 

Regards,

SeeThePicture

Share this post


Link to post
Share on other sites

Hi,

 

I'm using Chrome 19.0.1084.46 m.

 

I have a local apache server and MYSQL database set up on my laptop. I successfully interface with the db via php to get info, create XML data and generate flash charts. ... etc. etc. etc.

 

It's me (SeeThePicture). I would like to attempt to clarify my above post from "21 May 2012 - 09:32 PM".

 

Baseline:

When I use the Flash charts, I can successfully create charts using lines of PHP code that are very similar to those shown in Documentation's "Home > Guide for web developers > Using with PHP > Plotting from database -- Converting the example to use dataURL method":

 

Sharing my code on this forum would cause me to become confused because I feel I am a noob and I wouldn't want to clutter this forum with my hacked code. Therefore I will leverage samples from FusionCharts Documentation -- samples that look similar to what worked/didn't work for me.

 

From "Home > Guide for web developers > Using with PHP > Plotting from database -- Converting the example to use dataURL method":

I have success at doing this stuff:

 

------ "Chart Container Page - Default.php"

---------- Using encodedataurl to establish my fancy URL like $strDataURL = encodeDataURL("PieData.php?animate=1")

---------- Using echo renderchart to create the chart like echo renderChart("../../FusionCharts/Pie3D.swf", $strDataURL, "", "FactorySum", 600, 300, false, true);

------ "Creating the data provider page PieData.php"

---------- accessing the db

---------- creating my $strXML. -- "Create multi-series line chart"

 

Etc. etc. etc. It does work for me. :-) -- It works when I use Flash no problem there.

 

Trying to learn:

Now that I am trying to learn how to create the charts only using Javascript, I am at a point in my learning process where I first want to see on my localhost if I can even make a single javascript chart by doing something much more simple than the above. That's why I created a simple XML file for my learning and experimentation process (tryDataFromXmlGenerator.xml). I am trying to prove to myself that I can replicate what is done in your example "Explicitly render JavaScript only charts" using my simple xml file which I saved to my "public_html" folder. Only after I've reached that milestone will I venture forward and try to create JS charts by somehow referencing a URL callout like "$strDataURL = encodeDataURL("PieData.php?animate=1");". Know what I mean? One step at a time?

 

I appreciate your help as I try to figure this out.

 

Best Regards,

SeeThePicture

Edited by SeeThePicture

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Thank you for the post.

 

With regard to your issue, JavaScript chart not loading (instead showing : Loading Chart. Please wait.),

 

please note that FusionCharts JavaScript API consists of four JavaScript file.

 

JavaScript Files:

1. FusionCharts.js

2. FusionCharts.HC.js

3. FusionCharts.HC.Charts.js

4. jquery.min.js

 

For rendering JavaScript charts, FusionCharts makes use of FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js files but you do not need to load these files explicitly in HTML. FusionCharts.js automatically takes care of the loading.

 

So, please make sure these four files should present in your folder where FusionCharts.js file is present in your application.

 

To render the chart in JavaScript mode, you need to explicitly define the below mentioned code before rendering the chart. But this function will only work when you are using FusionCharts PHP Class to generate the chart,

 

Ref. Code:

$FC= new FusionCharts("Column3D, "350", "250");

$FC->setRenderer('javascript');

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi,

 

Thank you for the post.

 

With regard to your issue, JavaScript chart not loading (instead showing : Loading Chart. Please wait.),

 

please note that FusionCharts JavaScript API consists of four JavaScript file.

 

JavaScript Files:

1. FusionCharts.js

2. FusionCharts.HC.js

3. FusionCharts.HC.Charts.js

4. jquery.min.js

 

For rendering JavaScript charts, FusionCharts makes use of FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js files but you do not need to load these files explicitly in HTML. FusionCharts.js automatically takes care of the loading.

 

So, please make sure these four files should present in your folder where FusionCharts.js file is present in your application.

 

To render the chart in JavaScript mode, you need to explicitly define the below mentioned code before rendering the chart. But this function will only work when you are using FusionCharts PHP Class to generate the chart,

 

Ref. Code:

$FC= new FusionCharts("Column3D, "350", "250");

$FC->setRenderer('javascript');

 

Hope this helps!

 

Hello,

Yes, I think it will help. I hope it will. Thank you. So, tonight I played with FC PHP Class. I did this:

 

$FC = new FusionCharts("MSCombi2D",729,547,"Chart1");
$FC->setSWFpath("../MyFCPHPClassCharts/FusionCharts/");
$FC->setRenderer('javascript');

 

Now with regards to generating XML data, note that I do have a data provider page. Mine is very similar to PieData.php of your "Using with PHP Class --> Charting Data from Database." Except in order to generate my XML data, I pass variables to my page in the URL. It would be as if I do something like "PieData.php?ID2BeViewed=animal&myvar=1&currtime=5_16_2012_21_4_52." I know my data provider page works because if I were to go to http://localhost/Data/PieData.php?ID2BeViewed=animal&myvar=1&currtime=5_16_2012_21_4_52 I would instantly see nice XML displayed on my screen. But how do I get this to work now that I am trying to leverage FC PHP Class?

 

Before I enter a line that says, "$FC->renderChart();" I am guessing that I would need to somehow tell FC that I want FC to somehow generate XML data by going to PieData.php?ID2BeViewed=anima... etc. , right? Please advise. Do I use FC PHP Class' function "getXML()?" "renderchart()?" "renderChartFromExtData()?" Your continued help would be greatly appreciated. Your thoughts?

 

Thanks,

SeeThePicture

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

With regard to your query, it seems that, you have the external data provider page and wants to render the chart using FusionCharts PHP Class.

 

Please note that FusionCharts PHP Class (provided with some built-in PHP functions) is basically used for XML generation, chart configuration and rendering which actually saving a lot of time of chart generation.

 

If you want to provide XML data to your FusionCharts PHP Class API method "$FC->renderchart();" , you can only provide the XML string using "renderChartFromExtData();" method.

 

And "getXML();" method will retrieve the XML which already generated using FusionCharts PHP Class API.

 

So these two are of no use for you, since you want to provide URL of XML generator page.

 

Hence, you need to use FusionCharts PHP chart embedding function "renderchart();" and pass the complete URL as a XMLUrl parameter into it.

 

Ref. Code:

FC_SetRenderer("javascript");
$strDataURL="PieData.php?ID2BeViewed=animal&myvar=1&currtime=5_16_2012_21_4_52";
echo renderChart("../../FusionCharts/Pie3D.swf", $strDataURL, "", "FactorySum", 650, 450, false, false);

 

Please note that "$FC->renderChart();" method will not take the XML URL and is different from the above mentioned reference code.

 

Hope this helps!

Edited by Sashibhusan

Share this post


Link to post
Share on other sites

Hi,

 

With regard to your query, it seems that, you have the external data provider page and wants to render the chart using FusionCharts PHP Class.

 

Please note that FusionCharts PHP Class (provided with some built-in PHP functions) is basically used for XML generation, chart configuration and rendering which actually saving a lot of time of chart generation.

 

If you want to provide XML data to your FusionCharts PHP Class API method "$FC->renderchart();" , you can only provide the XML string using "renderChartFromExtData();" method.

 

And "getXML();" method will retrieve the XML which already generated using FusionCharts PHP Class API.

 

So these two are of no use for you, since you want to provide URL of XML generator page.

 

Hence, you need to use FusionCharts PHP chart embedding function "renderchart();" and pass the complete URL as a XMLUrl parameter into it.

 

Ref. Code:

FC_SetRenderer("javascript");
$strDataURL="PieData.php?ID2BeViewed=animal&myvar=1&currtime=5_16_2012_21_4_52";
echo renderChart("../../FusionCharts/Pie3D.swf", $strDataURL, "", "FactorySum", 650, 450, false, false);

 

Please note that "$FC->renderChart();" method will not take the XML URL and is different from the above mentioned reference code.

 

Hope this helps!

 

Thank you for this explanation. During my many "hacks" over the past few days I actually was able to implement something similar to your recommendation a few times. It does produce a chart, but I do not know that the chart is Javascript. I think the chart is Flash. Here's my simple test. After properly creating a chart, I right click on it.

 

If it is a Javascript chart, I would see this kind of right click menu:

FC_0002.png

 

If it is a Flash chart, I would see this kind of right click menu:

FC_0001.png

 

By using the "echo renderChart(..." method you prescribed and playing with my "right click test" I can see that I am always getting a Flash chart. :-(

 

I say "similar" above because you recommended "FC_SetRenderer("javascript")" but I've always been using "$FC->setRenderer('javascript');". What is the difference between the two?

 

The following line seems to get ignored as I always do get a chart, but it's a Flash chart. A new observation (I think since updating my FusionCharts.php file) is that I can faintly see the words "Reading Data. Please wait" through my chart which is partially transparent.

$FC->setRenderer('javascript');

 

Replacing the above line with the following line simply produces the symptom -- stuck at "Loading Chart. Please wait." No chart is produced.

FC_SetRenderer("javascript");

 

 

I am beginning to think I have a wrong version of file somewhere. Until about 15 minutes ago I didn't realize that I had an outdated version of "FusionCharts.php" in my Includes directory. Any thoughts? Could this be a clue leading us to root cause?

 

Regards,

SeeThePicture

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Let me make myself very clear that, if you want to use the FusionCharts PHP Class API method you need to first create an object of FusionCharts PHP class (like $FC used in FusionCahrts documentation) .

 

Then using the required methods using the object reference $FC.

 

For Example:

$FC->setRenderer('javascript');

 

But without using the FusionCharts PHP class API, you can also render the charts by simply using PHP and FusionCharts methods.

 

For Example:

FC_SetRenderer("javascript");

 

Please note that FC_SetRenderer(); is a FusionCharts PHP function which set the rendering mode (flash/javascript) explicitly (Default is set to flash).

 

To make you understand the use of FusionCharts PHP Class API I have attached the sample along with the screen shot of JavaScript chart for this sample.

 

Please UNZIP this file and open the Default.php from your PHP server, in the browser.

 

Before that you need to change the DBConn.php file and the PieData.php file as per your database structure. (or else use the orders.sql dump for this sample).

 

Hope this helps!

 

Thank you for this explanation. During my many "hacks" over the past few days I actually was able to implement something similar to your recommendation a few times. It does produce a chart, but I do not know that the chart is Javascript. I think the chart is Flash. Here's my simple test. After properly creating a chart, I right click on it.

 

If it is a Javascript chart, I would see this kind of right click menu:

FC_0002.png

 

If it is a Flash chart, I would see this kind of right click menu:

FC_0001.png

 

By using the "echo renderChart(..." method you prescribed and playing with my "right click test" I can see that I am always getting a Flash chart. :-(

 

I say "similar" above because you recommended "FC_SetRenderer("javascript")" but I've always been using "$FC->setRenderer('javascript');". What is the difference between the two?

 

The following line seems to get ignored as I always do get a chart, but it's a Flash chart. A new observation (I think since updating my FusionCharts.php file) is that I can faintly see the words "Reading Data. Please wait" through my chart which is partially transparent.

$FC->setRenderer('javascript');

 

Replacing the above line with the following line simply produces the symptom -- stuck at "Loading Chart. Please wait." No chart is produced.

FC_SetRenderer("javascript");

 

 

I am beginning to think I have a wrong version of file somewhere. Until about 15 minutes ago I didn't realize that I had an outdated version of "FusionCharts.php" in my Includes directory. Any thoughts? Could this be a clue leading us to root cause?

 

Regards,

SeeThePicture

post-23588-0-46817100-1337928277_thumb.png

PHP_DB-Sample (SeeThePicture).zip

Share this post


Link to post
Share on other sites

Hi,

 

Let me make myself very clear that, if you want to use the FusionCharts PHP Class API method you need to first create an object of FusionCharts PHP class (like $FC used in FusionCahrts documentation) .

 

Then using the required methods using the object reference $FC.

 

For Example:

$FC->setRenderer('javascript');

 

But without using the FusionCharts PHP class API, you can also render the charts by simply using PHP and FusionCharts methods.

 

For Example:

FC_SetRenderer("javascript");

 

Please note that FC_SetRenderer(); is a FusionCharts PHP function which set the rendering mode (flash/javascript) explicitly (Default is set to flash).

 

To make you understand the use of FusionCharts PHP Class API I have attached the sample along with the screen shot of JavaScript chart for this sample.

 

Please UNZIP this file and open the Default.php from your PHP server, in the browser.

 

Before that you need to change the DBConn.php file and the PieData.php file as per your database structure. (or else use the orders.sql dump for this sample).

 

Hope this helps!

 

Thank you for all your support, Sashibhusan. From your most recent reply I feel I have a better understanding of how to use FC PHP Class vs simply using PHP and FC methods.

 

Before leaving the house for work, I tried your recommendations. I wasn't seeing the expected results. I stopped by a breakfast restaurant and took my laptop with me into the restaurant again to your recommendations. I thought, "Since I am using localhost, I should be fine. I don't need WIFI." Upon my first try, without making any changes -- BOOM! I saw my beautiful JS FusionCharts! It turns out that because I had no WIFI, I was unable to call on some JQuery UI files that I've been unknowningly calling on. At the restaurant, my JS FusionCharts were working fine, but my JQuery components were dead. Then, I went to a place that had WIFI and I was back at square one. FC not able to function, but JQuery UI components working fine. I began to suspect that I was using severely outdated JQuery UI code and somehow this was causing a conflict with my FusionCharts. I updated JQuery UI. Now, everything is working beautifully together (on localhost).

 

Thank you for all your patience, perseverence and help.

 

On to my next question. I will create a new thread for that.

 

Thanks!

SeeThePicture

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Thank you for your response.

 

I am glad to hear that your issue has been resolved.:D

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