Sign in to follow this  
SuperDelic

Update Fc Dynamically Per User Input

Recommended Posts

Hello, all. I know I must be doing something wrong with syntax. What I have is a toolbar with buttons for various FusionCharts options, such as:

  • 2-D or 3-D
  • showSum
  • caption
  • subCaption
  • legendPosition
  • animation
  • showPercentageValues
  • canvasBgColor

et cetera, et cetera. However, I just can't seem to get the syntax correct to refresh the div with the Fusion chart (without refreshing entire page). In the example below, another function calls it with the following parms:

 

chartName=SWF file name w/out extension (e.g. StackedBar3D or MSColumn3D)

blnAnim=0 (false) or 1 (true)

blnShowSum=0 (false) or 1 (true)

xmlData=Data-only xml (no attributes)

 

function updateChart(chartName, blnAnim, blnShowSum) {

var chartReference = FusionCharts("chrtRptId");

 

chartReference.setChartAttribute("animation", blnAnim);

chartReference.setChartAttribute("showSum", blnShowSum);

chartReference.setChartAttribute("swfUrl", "../swf/" + chartName + ".swf");

chartReference.setXMLUrl(xmlData);

chartReference.render("chartdiv");

}

 

However, this current syntax only seems to reload the original chart. What am I doing wrong here?

Share this post


Link to post
Share on other sites

Hi,

 

If you call render the chart will reload or if you set another chart type.

 

Please try calling only the two lines below and you wil see the difference.

 

chartReference.setChartAttribute("animation", blnAnim);

chartReference.setChartAttribute("showSum", blnShowSum);

 

 

Please note that setChartAttribute internally updates an existing chart which is also redrawing the chart, but the redrawing takes place pretty fast to get this traced visibly.

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