Sign in to follow this  
DASU

Fusion charts with update panels are not working in asp.net application

Recommended Posts

Hi,

  We have a dropdown control and a fusion chart at bottom of the dropdown .On change of dropdown fusion chart should be updated accordingly these all controls are present in one update panel.

  LayOutLooks like this:

UpdatePanel1

Drop Down List

  Fusion chart which is dynamicall constructed on the basis some input critera following are the steps:

  1)Construct xml file with input critera(This is working fine  I have verified)

2)

if (IsPostBack)

  {

  //when a ajax call is made we use RenderChartHTML method

output = FusionCharts.RenderChartHTML("Charts/ScrollArea2D.swf", FileName,  chartHolder.ID, 350,450, false, false);

}

else

{

//When the page is loaded for the first time, we call RenderChart() method to avoid IE's 'Click here to

output = FusionCharts.RenderChart("Charts/ScrollArea2D.swf", FileName, "", chartHolder.ID, GPIUIConstants.GPI_CONST_FUSIONCHARTS_WIDTH, GPIUIConstants.GPI_CONST_FUSIONCHARTS_HEIGHT, false, false);

//chartHolder.InnerText = cabinetId;

}

chartHolder.Controls.Clear();

//Add Litaral control to Panel which adds the chart from outPut string

chartHolder.Controls.Add(new LiteralControl(output));

Here chartHolder is a dynamically created div element.

  Problem here is when we change dropdown fusion chars are not rendered with latest data every time eventhough the file has got the latest data.

 Please let me know if you need more infomation regarding this.

Thanks

Dasu.G

 

 

 

Share this post


Link to post
Share on other sites

Hi Dasu,

You would need to update the chart when the ajax response is obtained. Like this:

 <SCRIPT LANGUAGE="JavaScript">

  //updateChart method is called whenever the user clicks the button to

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

//data using setDataURL method.

function updateChart(DOMId){

  //Get reference to chart object using Dom ID

 var chartObj = getChartFromId("chart1Id");

 //Update it's URL

 chartObj.setDataURL("NewData.xml");

 //Disable the button

 this.document.frmUpdate.btnUpdate.disabled = true;

}

 </SCRIPT>

Hope this helps!

Srividya

Share this post


Link to post
Share on other sites

hi,

 

 

 

it might be some caching issue.

 

 

 

The XML file is bein cashed. Please pass a nocache querystring to the XML's URL. The value of this querystring should be something that is unique like miliseconds elapsed sice midnight or a global counter variable so that always a new unique value gets passed on each postback.

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