Flashy Karl

Members
  • Content count

    5
  • Joined

  • Last visited

About Flashy Karl

  • Rank
    Forum Newbie
  1. Argument passing in Drill Down Charts

    I am using the example code that is provided in the FusionCharts v3 online documentation. Guide for Web Developers/Using with PHP/PHP, JavaScript & (dataURL) method. Here is the javascript function from the example. It doesn't work when you pass a string value into it. function updateChart(factoryIndex){ //DataURL for the chart var strURL = "FactoryData.php?factoryId=" + factoryIndex; //Sometimes, the above URL and XML data gets cached by the browser. //If you want your charts to get new XML data on each request, //you can add the following line: //strURL = strURL + "&currTime=" + getTimeForURL(); //getTimeForURL method is defined below and needs to be included //This basically adds a ever-changing parameter which bluffs //the browser and forces it to re-load the XML data every time. //URLEncode it - NECESSARY. strURL = escape(strURL); //Get reference to chart object using Dom ID "FactoryDetailed" var chartObj = getChartFromId("FactoryDetailed"); //Send request for XML chartObj.setDataURL(strURL); } Here is the code that sets up the link and passes the parameter to this function. If a string is passed with only one word and no spaces the error is "the string name" is not defined. If you pass it a string with two words and a space the error is "missing)after argument list. missing ) after argument list and [break on this error] updateChart(Europe District) respectively. $strXML .= "";
  2. Argument passing in Drill Down Charts

    Was your problem resolved? I am having the same trouble. The javascript function only seems to accept numeric values not string values?
  3. I solved the problem. The problem lies in where the chart is rendered. echo renderChart("../../FusionCharts/Column2D.swf?ChartNoDataText=Please select a factory from pie chart above to view detailed data.", "", "", "RegionDetailed", 600, 250, false, false); This is the code that is supplied in the online documentation. It is incorrect, the words false need to be replaced by a 0 and a 1 for this to work. I discovered this further in the online documentation under FusionCharts and Javascript/JavaScript API's exposed. There is a little warning on the top of the page: "Please note that the events are raised only when registerWithJS flag of the chart is set to 1". If you then click on the API Method Signature setDataURL(strDataURL:String) link you will find an example with the 0 and 1.
  4. Thank you for the quick reply. I am following the PHP, JavaScript & dataURL example in the FusionCharts v3 online documentation. It is located in the Guide for Web Developers folder, under Using with PHP folder. This web page opens with a pie chart already populated and allows the user to drill down and get detailed information shown in a bar chart below. The error occurs when you click a peice of the pie to populate the detailed bar chart below. The error is "chartObj.setDataURL is not a function". Here is the javascript function code: <SCRIPT LANGUAGE="JavaScript"> /** * updateChart method is invoked when the user clicks on a pie slice. * In this method, we get the index of the factory after which we request for XML data * for that that factory from FactoryData.php, and finally * update the Column Chart. * @param factoryIndex Sequential Index of the factory. */ function updateChart(factoryIndex){ //DataURL for the chart var strURL = "FactoryData.php?factoryId=" + factoryIndex; //Sometimes, the above URL and XML data gets cached by the browser. //If you want your charts to get new XML data on each request, //you can add the following line: //strURL = strURL + "&currTime=" + getTimeForURL(); //getTimeForURL method is defined below and needs to be included //This basically adds a ever-changing parameter which bluffs //the browser and forces it to re-load the XML data every time. //URLEncode it - NECESSARY. strURL = escape(strURL); //Get reference to chart object using Dom ID "FactoryDetailed" var chartObj = getChartFromId("FactoryDetailed"); //Send request for XML chartObj.setDataURL(strURL); The underlined code is where the error occurs. I looked in the FusionCharts.js file and confirmed that the setDataURL function is there. I double checked and made sure that I had an include statement for this file as well. Thank you for your assistance. Karl
  5. I have the same error. I deleted the code and re-copied it from the online documentation as you suggested but still get the same error. echo renderChart("../../FusionCharts/Column2D.swf?ChartNoDataText=Please select a factory from pie chart above to view detailed data.", "", "<chart></chart>", "FactoryDetailed", 600, 250, false, false);Any help will be greatly appreciated. Thanks!