punkers

Members
  • Content count

    6
  • Joined

  • Last visited

About punkers

  • Rank
    Forum Newbie
  1. setDataXML

    Hi guys, I fixed my problem. Instead of using the javascript function setDataXML or set setDataURL i'm directly getting the component from the page and set the new attribute. this is the snippet of my javascript function, chart1 is the id of the chart in the page. var chart1 = new FusionCharts("${externalURL}flash/fusion/Line.swf", "chart1", "130", "70", "0", "1"); url1="/REGION/fusionchartxml.html?"; url1 = url1+"chartID=1&tn=1&d1="+d1+"&d2="+d2; chart1.variables.dataURL = encodeURIComponent(url1); chart1.render("chartdiv1"); Thx, Fabio
  2. setDataXML

    Hi, The code is: javascript var chart1 = new FusionCharts("${externalURL}flash/fusion/Line.swf", "1", "130", "70", "0", "1"); var chart2 = new FusionCharts("${externalURL}flash/fusion/Line.swf", "2", "130", "70", "0", "1"); function submitChart(chartNum,d1,d2) { url="/REGION/fusionchartxml.html?"; url = url+"chartID="+chartNum+"&tn=1&d1="+d1+"&d2="+d2; var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { if(xmlHttp.responseText!= null & xmlHttp.responseText!= ' '){ var xml=xmlHttp.responseText.replace(/'/g,'%26apos;');xml=xml.replace(/"/g,"'"); if(chartNum ==1 ){ var chartObj = getChartFromId("1"); chartObj.setDataXML(xml); chartObj.render("chartdiv1"); }else{ var chartObj = getChartFromId("2"); chartOb.setDataXML(xml; chartOb.render("chartdiv2"); } } } } xmlHttp.open("GET",url,true); xmlHttp.send(null); } jsp div id="chartdiv1" align="center">The chart will appear within this DIV. This text will be replaced by the chart. script> <%urlEncodedURL = "/REGION/fusionchartxml.html?" + URLEncoder.encode("chartID=0&tn=1&d1="+endDate+"&d2="+selectedDate, "UTF-8"); %> chart1.setDataURL("<%=urlEncodedURL%>"); chart1.render("chartdiv1"); /script> select name="range" onchange="submitChart('1','01-may-08','31-may-08')"> option value ="0">1 week option value ="1">2 weeks option value ="2">3 weeks option value ="3">1month option value ="4">2months /select> The code tag wasn't working for the last bit of code so I just cut the beginning of the tags. I'm using Firefox 2 and IE 7 with Tomcat and java 1.4.2. Thanks, Fabio
  3. setDataXML

    Hi, I created a page with just the chart and the select box in it. Now I don't get any javascript error but the chart doesn't change. Thx, Fabio
  4. setDataXML

    Hi, Have you received my code? Any news? Thx Fabio
  5. setDataXML

    Hi, The chart is not inside a form, I changed the Xml as you said but I still get the same error. Thx for your help.
  6. setDataXML

    Hi guys, I have got a problem trying to update data inside a chart. This is my code: var chart1 = new FusionCharts("${externalURL}flash/fusion/Line.swf", "1", "130", "70", "0", "1"); ....... var chartObj = getChartFromId("1"); chartObj.setDataXML(xmlHttp.responseText); the object xmlHttp.responseText contains the correct xml file. I got this error chartObj.setDataXML is not a function. I 've read the other related topics on the forum but I couldn't fix this error. Thx for your help.