My requirement is to generate charts using fusion charts.

I'm supposed to provide data to fusion charts from MongoDB which is a no SQL database.

MongoDB stores data into collections which is in the json format.and fusion charts accepts the data either in json format or in Xml format.

how should i provide the data to the fusion charts?

Currently I have written a java class to read the collection and put it into the .json file and I am passing this json file to the fusion charts(ie. a program written in html embedded with javascript)separately.I am stuck with the issue that how to call a java function from javascript?

Hence is there any other better alternative for this ??