Sign in to follow this  
dwp

Chartobj = Getchartfromid

Recommended Posts

Hi,

 

Please note that "getChartFromId( )" is a deprecated function that helps in accessing the JavaScript Object reference of the chart which you can use to call all the API functions.

 

You may try using the "FusionCharts( )" function to achieve the same and see if this helps.

Ref.- http://docs.fusioncharts.com/charts/contents/?JavaScript/API/Methods.html#getchartfromid

 

In case this does not help, we'll further look into the same.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Thanks for the response.

 

 

I have tried your suggestion and other possible responses, but still no results. The graph still doesn't appear.

 

 

The include <?php $chartInit=true; include("yr_vol.php"); ?> chart shows up just fine, but the chart to drill down to doesn't seem to show up no matter what I do to the code. It's like it isn't even there. No error messages, no chart.

 

Maybe it is because I am using a WAMP server setup on my computer? I have already included my charts in "trusted files" in the global settings for the Flash Player. However I have eliminated the browser issue as I get the exactn same results on all browsers.

I will include my code for the yr_vol.php file to see if you can find issues with the chart code. I will also attach the other relevant files since they might have changed since my first posting.

 

Thanks for your help!

yr_vol.php

chart_mo_vol.php

volume_dashboard.php

Share this post


Link to post
Share on other sites

Hi,

 

Can you try once :

 

1. removing all escape functions from volume_dashboard code

 

2. replace

var chartObjc = getChartFromId("chart_monthly_count");

with

var chartObjc = getChartFromId("yr_vol");

 

( there seems to be no chart with "chart_monthly_count" as id in your code )

 

and let us know?

Share this post


Link to post
Share on other sites

I have moved the charts online. I have been able to get the first and second chart to work. I have removed the code for the nonexistant chart. I cannot get the third chart to open.

 

As the code and page names have changed, please see the new code attached. The first and third charts are linked. The first chart shows yearly totals and I am trying to be able to click on one of the columns to view a chart with the monthly totals for that year. The third chart on the atest.php page is the monthly chart. I can't seem to get the third chart to show up at all. Can you please taken a look at it and see if something is missing?

 

 

Thanks, Doug

atest.php

servers.php

works_chart_mo_vol.php

yr_vol.php

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

With regard to your issue, could you please do changes in your code as per the points described below?

 

1.Replace in atest.php

 

var myCharta = new FusionCharts("Charts/Pie3D.swf", "servers", "400", "250", "false", "true");

 

with

var myCharta = new FusionCharts("Charts/Pie3D.swf", "servers", "400", "250", "0", "1");

 

2.Could you please confirm that the chart with "chart_monthly_count' ID is rendered successfully before updating in the JavaScript function "updateCharts()"?

 

3.Please check the JAvaScript variable "strURL" of "updateCharts()" function should be declared before assigning the URL string to it. Also Please try by unique variables for the URL string of each update in JavaScript function "updateCharts()".

 

4.In "works_chart_mo_vol.php" file:

 

Uncomment:

header('Content-type: text/xml');

 

Comment:

$strXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

 

In case if this is not sufficient to resolve your issue then, could you please provide the live URL to look into the issue from our end?

 

Awaiting your response!

Edited by Sashibhusan

Share this post


Link to post
Share on other sites

Sashibhusan,

 

 

Thank you for taking a look at this for me!

 

I am going crazy trying to find out why only two charts show up and the links from the first chart don't work. The code for "servers.php" and "chartcpo.php" is identical, yet only 'servers.php' shows up on the page.

 

I have simplified the code on each script and gotten rid of the "chart_monthly_count" file , but still have no clue why it isn't working after making the changes you suggested.

 

I will include the files used for charts here. Please see attachments. If this doesn't work, please go to http://www.applealleycafe.com/books/atest.php to see the results.

 

Thanks,

 

Doug

atest.php

chartcpo.php

servers.php

works_chart_mo_vol.php

yr_vol.php

Share this post


Link to post
Share on other sites

When I go to atest.php and opt to use the Internet Explorer script-debugger, I get the following error message:

 

 

Error: Object doesn't support property or method 'setDataUrl'

 

Is my code incorrect?

 

Please help. I still have the same problems trying to get mu charts to show up on my page.

 

 

Anyone can see the scripts and link above.

 

 

 

Share this post


Link to post
Share on other sites
Guest Rishi Choudhari

In atest.php:

 

1. Make sure you have a valid result in $recordyear. Unless you have this, the works_chart_mo_vol chart will not render.

2. You've included FusionCharts.php in a <script> tag.

3. setDataUrl is a deprecated method. Please use setXMLUrl, as specified clearly in the documentation. Where setDataXML is used, setXMLData is the newer equivalent method.

4. chartcpo.php does not return only XML content. It returns HTML tags as well. Set content type to text/xml for this page.

5. works_chart_mo_vol.php would return an error unless you supply $recordyear; which is why we ask you to confirm point #1.

 

Let us know if the above changes get your charts working.

Share this post


Link to post
Share on other sites

Rishi,

 

Thank you, I appreciate your input! Unfortunately, nothing worked.

 

1. You can see by viewing the source code that $recordyear has the proper value:

 

var myChartb = new FusionCharts("Charts/MSColumn3D.swf", "works_chart_mo_vol", "400", "250", "0", "1");

 

myChartb.setXMLData(escape("works_chart_mo_vol.php?record_year=2012"));

 

myChartb.render("works_chart_mo_volDiv");

 

 

 

2. I have removed FusionCharts.php from the script.

 

3. setDataUrl, setXMLUrl, setDataXML and setXMLData all return the same error message:Object doesn't support property or method 'setXMLData'

 

 

4. chartcpo.php code is identical to servers.php and neither has HTML code. servers.php renders fine without errors. I can't get it to return html tags. Maybe you can tell me how you got this result???

 

5. As stated in #1, $recordyear; returns the proper value.

 

 

 

Any more suggestions?

 

Doug

Share this post


Link to post
Share on other sites

OK, I have now been able to get chart 1, 2 & 4 of the four charts to show up on the page, however, I still am confused as to why the chart 3 won't show up. This chart is supposed to be rendered on startup and when a pillar in chart one is clicked on for the year, chart 3 is supposed to change. When I open the page the third chart is missing which says that there is no data to display, and when I try to envoke the third chart by clicking on a pillar in the first chart, I get the following error:

 

Error: Object doesn't support property or method 'setDataURL'

 

As mentioned in an earlier post, setDataUrl, setXMLUrl, setDataXML and setXMLData all return the same error message.

The $recordyear value is correct when you view the page source, but the chart still doesn't render.

 

 

Any ideas?

Share this post


Link to post
Share on other sites

Now I have taken care of all of the error messages and all I have now is text where the chart is supposed to go "No data to display."

 

Anyone know why there is no data? When I render the chart on another page by itself it shows the proper information without errors.

 

Any help would be apreciated.

atest.php

yr_vol.php

works_chart_mo_vol.php

Share this post


Link to post
Share on other sites

Thanks to everyone who helped send me in the right direction. I have solved the problems with your help. It turns out that part of my problem was my query to the database was incorrect for one of the charts.

 

This probloem is solved.

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

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

 

Happy FusionCharting.: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
Sign in to follow this