BeginnerNew

Integeration Of Fusion Charts With Jsp And Servlet

Recommended Posts

Hello,

I am trying to Integerate Fusion charts with my Jsp.

Initially, on the starting page jsp, the user enters some parametes. These parameters go to a different servlet on another remote machine which on taking these params generate some x,y values and return an xml as a response.

Now, I want to generate a graph using this xml in the jsp.

The problem is the dynamic nature of the url,

When I try to use this piece of code, where url is the final url which will hit the remote servlet. It does not show anything in the page.

 

<div id="chartContainer">FusionCharts will load here!</div>

<script type="text/javascript"><!--

 

var myChart = new FusionCharts( "FusionCharts/MSLine.swf",

"myChartId", "500", "500", "0", "1" );

myChart.setXMLUrl(<%=url%>);

 

myChart.render("chartContainer");

 

// -->

</script>

 

But if I send a hardcoded url into the same code like in the following example, I am able to see the graph.

I have made sure that the url in the above scenario is the same as the one below.

 

<div id="chartContainer">FusionCharts will load here!</div>

<script type="text/javascript"><!--

 

var myChart = new FusionCharts( "FusionCharts/MSLine.swf",

"myChartId", "500", "500", "0", "1" );

myChart.setXMLUrl("http://localhost:8080/mainServlet/plot?serverType=offRampReg&serverName=CPG_OFFRAMP_REG_EAST_1&serverName=CPG_OFFRAMP_REG_EAST_2&serverName=CPG_OFFRAMP_REG_WEST_1&serverName=CPG_OFFRAMP_REG_WEST_2&sampleRate=30&collectD=Memory_Buffered&startTime=2012-01-14%2000:00:00&endTime=2012-01-15%2000:00:00");

 

myChart.render("chartContainer");

 

// -->

</script>

 

How can I make this thing work?

 

Waiting for a response-

Manni

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

Welcome to the FusionCharts Forum :)

 

Thank you for the post.

 

Can you please try alerting the URL and check if it is the right one ?

 

Also, please share the stripped down project with us, we will need it for further testing.

 

Awaiting your response !

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