Sign in to follow this  
IDForums

Jsp Code For Ipad

Recommended Posts

Hi,

 

I am using fusioncharts v3.2.2 and would like to make necessary modifications to make it iPad compatible. I have placed FusionCharts.js, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js in my Files directory. I see blank charts on my iphone. Here's my JSP code:

 

   <jsp:include page="../Files/FusionChartsRenderer.jsp" flush="true"> 
       <jsp:param name="chartSWF" value="../Files/MSLine.swf" /> 
       <jsp:param name="strURL" value="Data/Data.xml" /> 
       <jsp:param name="strXML" value="" /> 
       <jsp:param name="chartId" value="dailyCounts" /> 
       <jsp:param name="chartWidth" value="600" /> 
       <jsp:param name="chartHeight" value="300" /> 
       <jsp:param name="debugMode" value="false" />
       <jsp:param name="renderer" value="javascript" /> 
    </jsp:include>

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your post.

 

 

FusionCharts allows you to create pure JavaScript-only charts that does not require Flash, hence enabling your chart in browsers where Flash is not supported like that of iPhone/iPad etc. This is achieved by setting the renderer attribute in fc:render tag as "javascript".

 

The code snippet below shows how you can achieve this:

 

<fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}" 
width="${chartData.width}" height="${chartData.height}" debugMode="false" 
registerWithJS="true" xmlUrl="${chartData.url}" renderer="javascript"/>

 

Hope this helps.

Share this post


Link to post
Share on other sites

Thank you Angshu. But, as soon as I add attribute renderer="javascript", I see 'Invalid Data' message (both on browser and iPad). Here are some relevant code snippets:

 

<head>
<script language="javascript" src="Files/js/FusionCharts.js"></script>
</head>
....
String outputStr="TopInst.jsp";
....
<td>
<fc:render chartId="TopInstTestCounts" swfFilename="Files/Column3D.swf" width="250" height="300" registerWithJS="true" xmlData="<%=outputStr%>" debugMode="false" renderer="javascript" />
</td>

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

 

Please make sure that there are no duplicate attributes or extra quotes (") mentioned in the XML of the chart. Although, the Flash chart ignores duplicate attributes, the JavaScript chart does a strict XML validation.

 

In case the issue still persists, please enable the "debugMode" of the chart in the HTML page and check with the XML invoked.

 

Hope this helps.

Share this post


Link to post
Share on other sites

Angshu,

 

I still have issues with chart rendering. The problem is that I am trying to feed output from one JSP from another JSP page. I could not find any examples for this scenario. Any help is highly appreciated.

 

Code in JSP1:


String TopInstTestCounts="";
TopInstTestCounts = "TopInstTestCounts.jsp";
....

<fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}" width="${chartData.width}" height="${chartData.height}" debugMode="true"  registerWithJS="false" [b]xmlUrl="<%=TopInstTestCounts%>" [/b]renderer="flash/javascript"/>

 

Please find the attached code in JSP2 and its output.

output.xml

TopInstTestCounts.jsp.txt

Edited by IDForums

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

I am unable to replicate the issue.

 

The Column3D chart is rendered fine with out any issues.

 

Please make sure that you have specified Column3D.swf file as the file name, instead of MSColumn3D.swf.

 

Hope this helps!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this