﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FusionCharts Forum / FusionCharts Free / JavaScript Problems   / Change SWF dynamically / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FusionCharts Forum</description><link>http://www.fusioncharts.com/forum/</link><webMaster>support@fusioncharts.com</webMaster><lastBuildDate>Tue, 02 Dec 2008 05:30:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>Hi,&lt;br&gt;Can you please check the pointers and give me feedback one by 1 ?&lt;br&gt;&lt;br&gt;1. Are you running the code in a localhost or server? IF not run in localhost or any server&lt;br&gt;2. Why are using using double escaping while sending DataURL?&lt;br&gt;&lt;br&gt;IT seem that the XML is not getting received somehow...please check the above poiinters for this..may be the double escape is doing the thing&lt;br&gt;</description><pubDate>Tue, 20 Nov 2007 01:33:51 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>Additionally, I have verified that my link is returning XML correctly, it seems everything is fine.&lt;br&gt;I think this might be a javascript problem.&lt;br&gt;&lt;br&gt;Here is a sample string of what resolved fine in my browser address path:&lt;br&gt;&lt;br&gt;http://host/Search/ChartFusion.xml?Query=Queue = 0 AND ( Created &gt; '2007-11-18 08:00:00' and Created &lt; '2007-11-24 08:00:00')&amp;Query2=Queue = 0 AND ( Resolved &gt; '2007-11-18 08:00:00' and Resolved &lt; '2007-11-24 08:00:00')&amp;SecondaryGroupBy=ResolvedMonthly&amp;debug=&amp;PrimaryGroupBy=CreatedDaily&lt;br&gt;&lt;br&gt;</description><pubDate>Mon, 19 Nov 2007 15:45:00 GMT</pubDate><dc:creator>tcraigen</dc:creator></item><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>I am having difficulties getting this to work correctly.&lt;br&gt;&lt;br&gt;I decided to re-draw the entire graph each time, on load of the page the graph renders fine.&lt;br&gt;But running this javascript:&lt;br&gt;&lt;br&gt;function da_DrawChart(type,webpath,query,w,h,debug) {&lt;br&gt;&lt;br&gt;      var width = 800, height = 560;&lt;br&gt;      try {&lt;br&gt;        if(w != undefined) {&lt;br&gt;          width = w;&lt;br&gt;        }&lt;br&gt;        if(h != undefined) {&lt;br&gt;          height = h;&lt;br&gt;        }&lt;br&gt;        //var chart1 = new FusionCharts("/NoAuth/charts/Column3D.swf", "RTDynamicChart", width, height, debug, "1");&lt;br&gt;          var chart1 = new FusionCharts(type, "RTDynamicChart", width, height, debug, "1");&lt;br&gt;          if((query == undefined) || (query == null))&lt;br&gt;          {&lt;br&gt;            //initialize the chart&lt;br&gt;            chart1.setDataXML("&lt;chart&gt;&lt;/chart&gt;");&lt;br&gt;          } else {&lt;br&gt;            chart1.setDataURL( webpath + escape(escape(query)) );&lt;br&gt;          }&lt;br&gt;          chart1.render("fusion_chart");//this is the div tag the graph will be rendered in&lt;br&gt;      &lt;br&gt;      } catch(e) {&lt;br&gt;          alert("ERROR: " + e);&lt;br&gt;      }&lt;br&gt;   &lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;br&gt;I use the same exact function when I load the page, I have not seen a clear explanation why one function works the first time, and not the second. Do I need to completely delete the DOM object or use another ID?&lt;br&gt;&lt;br&gt;&lt;br&gt;Here is my XML for the first one:&lt;br&gt;Could someone fix the code or tell me how to display XML inline, code does not work...&lt;br&gt;[verbatim]&lt;br&gt;&lt;chart animation="0" baseFont="Arial" baseFontSize="14" caption="CreatedDaily vs. ResolvedMonthly" decimals="0" formatNumberScale="0" palette="4" showLabel="0" showValues="0" useRoundEdges="1" xAxisName="Monthly" yAxisName="Tickets"&gt;&lt;br&gt;&lt;categories&gt;&lt;br&gt;&lt;category label="2007-11"/&gt;&lt;br&gt;&lt;category label="2007-11-18"/&gt;&lt;br&gt;&lt;category label="2007-11-19"/&gt;&lt;br&gt;&lt;/categories&gt;&lt;br&gt;&lt;dataset color="26AAFD" seriesName="CreatedDaily" showValues="0"&gt;&lt;br&gt;&lt;set value="0"/&gt;&lt;br&gt;&lt;set value="1"/&gt;&lt;br&gt;&lt;set value="1"/&gt;&lt;br&gt;&lt;/dataset&gt;&lt;br&gt;&lt;dataset color="F47840" seriesName="ResolvedMonthly"&gt;&lt;br&gt;&lt;set value="4"/&gt;&lt;br&gt;&lt;set value="0"/&gt;&lt;br&gt;&lt;set value="0"/&gt;&lt;br&gt;&lt;/dataset&gt;&lt;br&gt;&lt;/chart&gt;&lt;br&gt;[/verbatim]&lt;br&gt;&lt;br&gt;Clicking the link inside the SWF does not take me to the correct data (it would be nice for the fusion charts to give us the real link, as using special characters does not resolve correctly when you click the link), I know this.&lt;br&gt;But I do know that rendering the graph separate, or even first will draw the graph.&lt;br&gt;&lt;br&gt;Here is the debug for the second graph:&lt;br&gt;Info: Chart loaded and initialized.&lt;br&gt;Initial Width: 800&lt;br&gt;Initial Height: 560&lt;br&gt;Scale Mode: noScale&lt;br&gt;Debug Mode: Yes&lt;br&gt;Application Message Language: EN&lt;br&gt;Version: 3.0.4&lt;br&gt;Chart Type: Single Series 3D Column Chart&lt;br&gt;Chart Objects: &lt;br&gt;BACKGROUND&lt;br&gt;CANVAS&lt;br&gt;CAPTION&lt;br&gt;SUBCAPTION&lt;br&gt;YAXISNAME&lt;br&gt;XAXISNAME&lt;br&gt;DIVLINES&lt;br&gt;YAXISVALUES&lt;br&gt;DATALABELS&lt;br&gt;DATAVALUES&lt;br&gt;TRENDLINES&lt;br&gt;TRENDVALUES&lt;br&gt;DATAPLOT&lt;br&gt;TOOLTIP&lt;br&gt;VLINES&lt;br&gt;&lt;br&gt;INFO: XML Data provided using dataURL method.&lt;br&gt;dataURL provided: /Search/ChartFusion.xml?Query%3DQueue%20%3D%20%27TSE%27%20AND%20%28%20&lt;br&gt;Created%20%20%3E%20%272007-11-18%2008%3A00%3A00%27%20and%20Created&lt;br&gt;%20%20%3C%20%272007-11-24%2008%3A00%3A00%27%29%26PrimaryGroupBy%3DCreatedDaily&lt;br&gt;dataURL invoked: &lt;br&gt;&lt;br&gt;&lt;br&gt;</description><pubDate>Mon, 19 Nov 2007 12:01:49 GMT</pubDate><dc:creator>tcraigen</dc:creator></item><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;if you wish to relaod the swf using AJAX ..i mean setting Div 's innerHTML from responseText, please do not accept any javascript as responseText becuase that wont evaluate. Rather try to render your chart HTML  from serverside using renderChartHTML (using FusionCharts.asp/FusionCharts.php/.NET assembly etc.) method.&lt;/P&gt;&lt;P&gt;If you have no need to change your chart type .. you can simply fetch the XML using ajax and set it live to the existing chart using setDataXML js method.</description><pubDate>Tue, 06 Nov 2007 00:41:39 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>Could easily be done via an AJAX call, no ?</description><pubDate>Mon, 05 Nov 2007 14:30:49 GMT</pubDate><dc:creator>funkmyer</dc:creator></item><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>Thanks for the confirmation.&lt;br&gt;&lt;br&gt;The performance isn't too bad using that method but I may adjust my page design to accommodate 2 visual charts then I won't need to reload the swf file.</description><pubDate>Sun, 14 Oct 2007 18:14:15 GMT</pubDate><dc:creator>mayberry</dc:creator></item><item><title>RE: Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>hi,&lt;/P&gt;&lt;P&gt;i am afraid that that process is the only simple way out, because you need to load the swf everytime you need to change the chart.</description><pubDate>Sat, 13 Oct 2007 10:12:57 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>Change SWF dynamically</title><link>http://www.fusioncharts.com/forum/Topic2705-47-1.aspx</link><description>I would like to use multiple charts in a page and let users choose different charts for different types of data.  Changing the XML url or XML string isn;t a problem, but is there a way to dynamically change the SWF file and rerender a chart ?&lt;br&gt;&lt;br&gt;I've tried using :&lt;br&gt;&lt;br&gt;charObj.setAttribute('swf', 'new/flash/source.swf');&lt;br&gt;charObj.render('chartdiv1');&lt;br&gt;&lt;br&gt;But this doesn't seem to do the trick.   At the moment I'm just not registering my charts in JS and rebuilding the entire chart object each time.  But this approach doesn't feel elegant enough.&lt;br&gt;</description><pubDate>Fri, 12 Oct 2007 11:15:18 GMT</pubDate><dc:creator>mayberry</dc:creator></item></channel></rss>