rthere Report post Posted June 20, 2009 I am using the drill down chart as described in the example http://www.fusioncharts.com/docs/Contents/PHP_JS_URL.html There is an updateChart() javascript function to which i would like to send multiple arguments. But when i tried to change the arguments to text files, I am getting error saying 'all command not found'. 'all-regr' is the argument i am trying to pass. Here is the specific code snippet i am referring to. I am copying the definition of the updateChart as i have not changed it from the original. When the argument is a single number like $matches[2] in the case below everything works fine. But when it is a string argument, the browser is trying to execute the argument as a command. I tried various forms of escaping to no avail. I have seen the unescapeLinks comment in a different post and have tried it. But that did not fix the problem either. Thanks for the help. <code> $strXML = "<chart unescapeLinks='0' palette='4' piefillAlpha='34' pieBorderThickness='1' hoverFillColor='FDCEDA' pieBord erColor='666666' baseFontSize='9' useHoverColor='1' showLabels='1' showValues='1' caption='LSF Usage By Project' showShadow= '0'>"; $strXML .= "<category label='all-regr'>"; system("../../../../../../site_overview/mypbstree.pl -l7 -gall-regr| grep Group", $pbsProjects, $retVal); exec("cat text.txt", $pbsProjects, $retVal); $i=0; foreach ($pbsProjects as $projects) { $i += 1; preg_match('/Group = (.*),(d*),(d*)/', $projects, $matches); //Note that we're setting link as updateChart(factoryIndex) - JS Function $strXML .= "<category value='" . $matches[2]. "' label='" . $matches[1] . "' link='javaScript:updateChart(".$matches[1 ].")'>"; $strXML .= "</category>"; } $strXML .= "</category>"; //Finally, close <chart> element $strXML .= "</chart>"; </code> Share this post Link to post Share on other sites
Rahul Kumar Report post Posted June 24, 2009 Hi, Could you please post the generated XML? Share this post Link to post Share on other sites
Flashy Karl Report post Posted February 19, 2010 Was your problem resolved? I am having the same trouble. The javascript function only seems to accept numeric values not string values? Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted February 22, 2010 Hi, Could you please send us the XML codes that you are using, as an attachment? Awaiting your reply. Share this post Link to post Share on other sites
Flashy Karl Report post Posted February 22, 2010 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 .= ""; Share this post Link to post Share on other sites