razr99

Challenging Implementation

Recommended Posts

I have a great interest in Fusion Chart for a web application we're developing at work. In order to pitch the buying of a license to my boss, I need to make it work first and I'm having some issues with the implementation. I have it all working with a php charting library, but it doesn't look half as nice as Fusion Charts. So, here's a description of my implementation:

 

I have a page that reads the data from a MySQL DB. The data is presented using jQuery tabs. The tabs are dynamically generated, since I don't know how many and which topics are to be displayed to the user. This app collects measures for patients in different clinical areas (Asthma, Diabetes and so on).

This page with the tabs is called measureDataForm.php. Clicking on a tab displays the data that is under the tab category. For instance. If a practice is collecting measures on Asthma and Diabetes they would see a page with 3 tabs (ALL, ASTHMA and DIABETES). Upon clicking on a tab, a page called tabs.php is invoked with some parameters and the data (which is a form to collect measures) loads inside the tabbed area.

 

Now, this page (tabs.php) has a form with several text boxes used to collect measures. Clicking on a text box changes the chart (which sits on the top of the measureDataForm.php page.

 

Currently my chart is rendered as an image, so I wrote a function that passes some parameters and asynchronously calls a page named chart.php which renders the chart. Because it's an image it's easy to just change the inner HTML of my div in the page measureDataForm.php to load the right chart. I want to make all of this using Fusion Charts, but not sure how to proceed.

 

I'm attaching a screenshot of the page to make it easy to understand. I know it's complicated and I might not have done a good job explaining it.

post-27540-0-77349900-1329858732_thumb.jpg

Edited by razr99

Share this post


Link to post
Share on other sites
Guest Sumedh

Greetings, smile.gif

 

FusionCharts XT v3.2.2 provides the feature to update chart data, and render accordingly.

 

According to your mentioned requirement, you can try to provide data in the textboxes, then save it.

 

Then, send this data back to your server. Using this you can regenerate the chart's XML with new data.(updated data)

 

Then, send this updated data to the charts using 'object.setXMLData("XML string")' function.

 

Thus, the new data entered will be reflected in your chart.

 

For more information on updating data, please read: http://docs.fusioncharts.com/charts/contents/?JavaScript/JS_ChangeData.html

 

Hope this helps. smile.gif

Share this post


Link to post
Share on other sites

I'm reading the documentation you sent me to and it's starting to make sense now.

I have one question that may seem obvious, but not to me.

Code from the documentation

function [b]changeMonth[/b](){
var chartReference = FusionCharts("myChartId");
chartReference.setXMLUrl("SeptemberData.xml");
}

It refers to September.xml. In my case I'd have to use php to generate the xml files on the fly, so the file extension would be .php. Does the extension matter or as long as it's a well formatted xml it should work? If it must be a xml extension, any ideas on how to proceed?

 

Thanks

 

Greetings, smile.gif

 

FusionCharts XT v3.2.2 provides the feature to update chart data, and render accordingly.

 

According to your mentioned requirement, you can try to provide data in the textboxes, then save it.

 

Then, send this data back to your server. Using this you can regenerate the chart's XML with new data.(updated data)

 

Then, send this updated data to the charts using 'object.setXMLData("XML string")' function.

 

Thus, the new data entered will be reflected in your chart.

 

For more information on updating data, please read: http://docs.fusionch...ChangeData.html

 

Hope this helps. smile.gif

Share this post


Link to post
Share on other sites

Got it working. I should have tried before asking the question.

 

Thank you for your help. Greatly appreciated!!

 

I'm reading the documentation you sent me to and it's starting to make sense now.

I have one question that may seem obvious, but not to me.

Code from the documentation

function [b]changeMonth[/b](){
var chartReference = FusionCharts("myChartId");
chartReference.setXMLUrl("SeptemberData.xml");
}

It refers to September.xml. In my case I'd have to use php to generate the xml files on the fly, so the file extension would be .php. Does the extension matter or as long as it's a well formatted xml it should work? If it must be a xml extension, any ideas on how to proceed?

 

Thanks

 

 

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