shinezee

Data update (chart refreshing) using Spring MVC

Recommended Posts

hello, im using the FusionChart with Spring MVC, all works good for now, but i encountered a problem.

 

 

 

i have a search box in the web which provides a date from/to search fonctionality, the from/to dates wille be obtained by Spring mvc and it will go search in a mysql database, the search result will be encapsulated in xml format that fits the FusionChart require and sent to the page.

 

 

 

there is the problem, what should i do to only refresh the chart rather than refresh the whole page??? what is your strategy??

 

 

 

thank you.

Edited by Guest

Share this post


Link to post
Share on other sites

Hi

Glad that you were able to integrate FusionCharts with Spring.

In order to refresh only the chart, ( instead of the whole page ) you could do the following:

1. Make ajax request for new data

2. Set this data to the chart using the following

[/code]

  <SCRIPT LANGUAGE="JavaScript">

 //Here, we get a reference to the chart and update it's

 //data using setDataXML method.

 function updateChart(DOMId,xml){

  //Get reference to chart object using Dom ID

var chartObj = getChartFromId("chart1Id");

//Update it's XML

chartObj.setDataXML(xml); 

 }

</SCRIPT>

[/code]

This way, only the chart will get updated.

Hope this is what you were looking for. :)

Srividya

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

We will be glad to help you to resolve your issue.

Awaiting your reply. :hehe:

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Thanks for your kind words.

We are glad that your issue is resolved.

Keep smiling and keep FusionCharting. :)

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