Ranen Report post Posted February 6, 2013 Hello, I am new to Fusion charts. I am able to deploy and successfully run the example .war file(= FusionCharts_J2EE.war). After that, what I did - is create a new dynamic web project, followed the instructions properly and just trying to run the - http://localhost:8181/FusionChartsTestExample/SimpleChart.jsp( which is JSP Basic Examples) But I am unable to see the chart - I got "Chart" instead of the chart, I printed the return object and I got full xml data, basically somewhere the below part is not working, mind you, I followed all the steps like putting proper .jar files, templates etc. I guess the problem is here- <fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}" width="${chartData.width}" height="${chartData.height}" debugMode="false" registerWithJS="false" xmlUrl="${chartData.url}" /> </c:catch> It did not print Tag Error, that means it still in <fc:render> Any idea where am I doing wrong. Thanks, Ranen Share this post Link to post Share on other sites
deepti Report post Posted February 7, 2013 Set debug to true and see what is displayed.You may be able to get some idea on what is happening.Also see if the swf is available.You may check that in firebug. Hello, I am new to Fusion charts. I am able to deploy and successfully run the example .war file(= FusionCharts_J2EE.war). After that, what I did - is create a new dynamic web project, followed the instructions properly and just trying to run the - http://localhost:8181/FusionChartsTestExample/SimpleChart.jsp( which is JSP Basic Examples) But I am unable to see the chart - I got "Chart" instead of the chart, I printed the return object and I got full xml data, basically somewhere the below part is not working, mind you, I followed all the steps like putting proper .jar files, templates etc. I guess the problem is here- <fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}" width="${chartData.width}" height="${chartData.height}" debugMode="false" registerWithJS="false" xmlUrl="${chartData.url}" /> </c:catch> It did not print Tag Error, that means it still in <fc:render> Any idea where am I doing wrong. Thanks, Ranen Share this post Link to post Share on other sites
Ranen Report post Posted February 7, 2013 Set debug to true and see what is displayed.You may be able to get some idea on what is happening.Also see if the swf is available.You may check that in firebug. Thanks Deepti, I found the error, but do not know how to fix - here is whats my findings:- One which works(comes from Fusioncharts .war) firbug's content area out put:- <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Plotting single series chart from data contained in Array.</h2> <div class="gen-chart-render"> <div id="productSalesDiv" align="center"> <object type="application/x-shockwave-flash" lang="EN" class="FusionCharts" data="../../FusionCharts/Column3D.swf" width="600" height="300" id="productSales" style="visibility: visible;"> <param name="scaleMode" value="noScale"/> <param name="scale" value="noScale"/> <param name="wMode" value="opaque"/> <param name="allowScriptAccess" value="always"/> <param name="quality" value="best"/> <param name="flashvars" value="lang=EN&debugMode=0&dataXML=%3Cchart%20caption%3D'Sales%20by%20Product'%20numberPrefix%3D'%24'%20formatNumberScale%3D'0'%3E%3Cset%20label%3D'Product%20A'%20value%3D'567500'%20%2F%3E%3Cset%20label%3D'Product%20B'%20value%3D'815300'%20%2F%3E%3Cset%20label%3D'Product%20C'%20value%3D'556800'%20%2F%3E%3Cset%20label%3D'Product%20D'%20value%3D'734500'%20%2F%3E%3Cset%20label%3D'Product%20E'%20value%3D'676800'%20%2F%3E%3Cset%20label%3D'Product%20F'%20value%3D'648500'%20%2F%3E%3C%2Fchart%3E&DOMId=productSales®isterWithJS=1&chartWidth=600&chartHeight=300&InvalidXMLText=Invalid data.&dataURL="/> </object> </div> <script type="text/javascript"> 1 var chart_productSales = new FusionCharts({"renderAt":"productSalesDiv","id":"productSales","debugMode":"0","dataSource":"<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'><set label='Product A' value='567500' /><set label='Product B' value='815300' /><set label='Product C' value='556800' /><set label='Product D' value='734500' /><set label='Product E' value='676800' /><set label='Product F' value='648500' /></chart>","dataFormat":"xml","swfUrl":"../../FusionCharts/Column3D.swf","registerWithJS":"0","height":"300","width":"600"}).render(); </script> </div> <div class="clear"/> <p/> <p class="small"> </p> <div class="underline-dull"/> </div> </div> One which does not work:- firebug content area: <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Plotting single series chart from data contained in Array.</h2> <div class="gen-chart-render"> <div id="productSalesDiv" align="center">Chart.</div> <script type="text/javascript"> 1 var chart_productSales = new FusionCharts({"dataFormat":"xml","dataSource":"<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'><set label='Product A' value='567500' /><set label='Product B' value='815300' /><set label='Product C' value='556800' /><set label='Product D' value='734500' /><set label='Product E' value='676800' /><set label='Product F' value='648500' /></chart>","height":"300","width":"600","swfUrl":"C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/Column3D.swf","registerWithJS":"0","renderAt":"productSalesDiv","debugMode":"0","id":"productSales"}).render(); </script> </div> <div class="clear"/> <p/> <p class="small"> </p> <div class="underline-dull"/> </div> </div> After looking the above debugging code - i think somewhere my .js and .swf files are not loaded , I tried 2 ways to load <c:set var="folderPath" value="../../FusionCharts/"/> <c:set var="folderPath" value="C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/"/> And also I saw in firebug, the js file and css are not accessible - Access to restricted URI denied. Why do I get this kind of error, thanks Share this post Link to post Share on other sites
Ranen Report post Posted February 7, 2013 To add my above reply, here is my directory structures:- My jsps are inside WEB-INF/ folder, in case of examples frfom fusioncharts, its just outside Web-Inf, but I want inside Web inf Thanks Deepti, I found the error, but do not know how to fix - here is whats my findings:- One which works(comes from Fusioncharts .war) firbug's content area out put:- <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Plotting single series chart from data contained in Array.</h2> <div class="gen-chart-render"> <div id="productSalesDiv" align="center"> <object type="application/x-shockwave-flash" lang="EN" class="FusionCharts" data="../../FusionCharts/Column3D.swf" width="600" height="300" id="productSales" style="visibility: visible;"> <param name="scaleMode" value="noScale"/> <param name="scale" value="noScale"/> <param name="wMode" value="opaque"/> <param name="allowScriptAccess" value="always"/> <param name="quality" value="best"/> <param name="flashvars" value="lang=EN&debugMode=0&dataXML=%3Cchart%20caption%3D'Sales%20by%20Product'%20numberPrefix%3D'%24'%20formatNumberScale%3D'0'%3E%3Cset%20label%3D'Product%20A'%20value%3D'567500'%20%2F%3E%3Cset%20label%3D'Product%20B'%20value%3D'815300'%20%2F%3E%3Cset%20label%3D'Product%20C'%20value%3D'556800'%20%2F%3E%3Cset%20label%3D'Product%20D'%20value%3D'734500'%20%2F%3E%3Cset%20label%3D'Product%20E'%20value%3D'676800'%20%2F%3E%3Cset%20label%3D'Product%20F'%20value%3D'648500'%20%2F%3E%3C%2Fchart%3E&DOMId=productSales®isterWithJS=1&chartWidth=600&chartHeight=300&InvalidXMLText=Invalid data.&dataURL="/> </object> </div> <script type="text/javascript"> 1 var chart_productSales = new FusionCharts({"renderAt":"productSalesDiv","id":"productSales","debugMode":"0","dataSource":"<chart caption='Sales by Product' numberPrefix=' formatNumberScale='0'><set label='Product A' value='567500' /><set label='Product B' value='815300' /><set label='Product C' value='556800' /><set label='Product D' value='734500' /><set label='Product E' value='676800' /><set label='Product F' value='648500' /></chart>","dataFormat":"xml","swfUrl":"../../FusionCharts/Column3D.swf","registerWithJS":"0","height":"300","width":"600"}).render(); </script> </div> <div class="clear"/> <p/> <p class="small"> </p> <div class="underline-dull"/> </div> </div> One which does not work:- firebug content area: <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Plotting single series chart from data contained in Array.</h2> <div class="gen-chart-render"> <div id="productSalesDiv" align="center">Chart.</div> <script type="text/javascript"> 1 var chart_productSales = new FusionCharts({"dataFormat":"xml","dataSource":"<chart caption='Sales by Product' numberPrefix=' formatNumberScale='0'><set label='Product A' value='567500' /><set label='Product B' value='815300' /><set label='Product C' value='556800' /><set label='Product D' value='734500' /><set label='Product E' value='676800' /><set label='Product F' value='648500' /></chart>","height":"300","width":"600","swfUrl":"C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/Column3D.swf","registerWithJS":"0","renderAt":"productSalesDiv","debugMode":"0","id":"productSales"}).render(); </script> </div> <div class="clear"/> <p/> <p class="small"> </p> <div class="underline-dull"/> </div> </div> After looking the above debugging code - i think somewhere my .js and .swf files are not loaded , I tried 2 ways to load <c:set var="folderPath" value="../../FusionCharts/"/> <c:set var="folderPath" value="C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/"/> And also I saw in firebug, the js file and css are not accessible - Access to restricted URI denied. Why do I get this kind of error, thanks Share this post Link to post Share on other sites
FusionCharts Support Report post Posted February 8, 2013 Hi, Resource Access restriction is an issue with the Browser and your server. Please understand that FusionCharts is a client-side based component. The SWF will just streamed to the browser as you stream an image file. The SWF will play and render chart at client side (browser). The URL that you are setting for the chart i.e. C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/ is not likely to work in majority of the cases. It is better that you pass a relative URL (based on your server's path etc. ) of the JS and SWF files. Again, if you are having the same machine where you have the server and where you are browsing, the path C:/ will not work in Web Browser context. You need to provide a Web safe URL like file:///C:/... However, the above is not recommended, as that will pass your tests only in your machine or only in those machines (only Windows machines) that has the same local folder structure. You need to consider the paths from Web scenario. Share this post Link to post Share on other sites