views:

212

answers:

1

An html page contains FusionCharts component. Below this component are a couple of html controls supposed to filter date for this component. Initially, there was a problem updating the chart component, upon clicking "Filter" button I used the following code:

currentChart.setDataURL(url);
currentChart.render("ChartDiv");

It didn't work. It merely reloaded the same url. It worked only when I started to nullify previous chart object and created a new one at the same place, instead of updating

currentChart = new FusionCharts('/FusionCharts/Maps/FCMap_WorldwithCountries.swf', "countryChart", "550", "200", "0", "1");
currentChart.setDataURL(url);
currentChart.render("ChartDiv");

Am I right that one cannot update existing chart object, only recreate it with a new url?

A: 

Hi Asaph,

Could you please try with the following code to update your chart dynamically?

var fc = getChartFromId("countryChart");
fc.setDataURL(url);
Rahul Kumar