Sign in to follow this  
Sunnywei

How To Display Multiple Charts With Struts2 In Jsp

Recommended Posts

Hi All,

 

I'm Cherry,has studied fusionchart for 2 days.Now i have a issue need a hand :)

According to customer's requirement, i need to display multiple charts in JSP including Pie3D,Column,StackedColumn and so on.

Because our product developed with Struts2-Spring-Hibernate, so now i wrap a list<ChartBean> in action and i want to iterator the list combine the fursionchart tag <fc:render> to display all charts i wrapped in JSP.

But I found that <fc:render> as if not support struts2 tags,such as <s:property value=""/>

 

Here are some code in JSP,commonList wrap some ChartBean object,ChartBean contains title,swfFilename,chartId,xmlData and so on properties.

<s:iterator value="#request.commonList" status="status">

<div class="dashboardtitle" style="margin-top:4px;"><s:property value="title"/></div>

<fc:render swfFilename='<s:property value="swfFilename"/>' chartId='<s:property value="chartId"/>' height="500" width="300" xmlData='<s:property value="xmlData"/>'></fc:render>

</s:iterator>

 

The property value of title can be displayed correctly but others in tag <fc:render> can't

 

Could you tell me a available method to display multiple charts in JSP?

Thanks in advance!

Edited by Sunnywei

Share this post


Link to post
Share on other sites

yeah,the issue has been solved.

I try to use JSTL <c:forEach> tag instead of <s:iterator> to display multiple charts in JSP.

Code:

<c:forEach items="${commonList}" var="chartdb" varStatus="status">

<div class="dashboardtitle" style="margin-top:4px;">${chartdb.title}</div>

<fc:render swfFilename="${chartdb.swfFilename}" chartId="${chartdb.chartId}" height="${chartdb.width}" width="${chartdb.height}" xmlData="${chartdb.xmlData}">

</fc:render>

</c:forEach>

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

We are glad to know that you have managed to solve your issue.

 

Keep smiling and keep FusionCharting!biggrin.gif

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