Sign in to follow this  
ganiganesh

Removing Chartid

Recommended Posts

Hi Team,

 

how can i delete the older chartid for charts?

 

For example if i use one chartid like myChartID in chart

 

var myChart = new FusionCharts("AngularGauge.swf","myChartID","265", "135", "0", "0");

 

i should use uniqueid in fusion charts XT so if i use myChartID for one more chart its giving error.

 

but i am creating more charts dynamically using same id like myChartID

 

my idea is that can i delete chartid before using the same chartid for other chart?

 

please suggest me

 

 

 

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi Team,

 

how can i delete the older chartid for charts?

 

For example if i use one chartid like myChartID in chart

 

var myChart = new FusionCharts("AngularGauge.swf","myChartID","265", "135", "0", "0");

 

i should use uniqueid in fusion charts XT so if i use myChartID for one more chart its giving error.

 

but i am creating more charts dynamically using same id like myChartID

 

my idea is that can i delete chartid before using the same chartid for other chart?

 

please suggest me

 

 

 

 

Hi,

 

You can remove a chart instance from page and memory using dispose() function.

 

Ref. Code:

FusionCharts("myChartId").dispose();

Share this post


Link to post
Share on other sites

Thanks for your reply. where should i put the code which u send?

 

can i use that in jsp?

 

Hi,

 

You can remove a chart instance from page and memory using dispose() function.

 

Ref. Code:

FusionCharts("myChartId").dispose();

Share this post


Link to post
Share on other sites

My requirement is that when I click on each segment on multipiechart I should have to refresh 6 angular graphs with the corresponding data, figure is shown in attachment.

 

I am generating 6 charts using dojo Ajax dynamically as shown below.

<BR style="mso-special-character: line-break"><BR style="mso-special-character: line-break">

 

function ajaxLink(divID, url,chartIDM) {

 

alert(chartIDM);

 

var dataContainer = document.getElementById(divID);

 

dojo.io.bind(

 

{

 

url: url,

 

content:

 

{

 

ajax:true,

 

engine: 'dojo'

 

},

 

load:function(type, data, event)

 

{

 

dataContainer.innerHTML = data;

 

var myAjax = new FusionCharts("AngularGauge.swf",chartIDM,"265", "135", "0", "0");

 

myAjax.setDataXML(data);

 

myAjax.addParam("WMode", "Transparent");

 

myAjax.render(divID);

 

}

 

});

 

}

 

 

calling the above functionlike

 

ajaxLink('chartdiv1',encodeURI(str),'myChartIdB1')

ajaxLink('chartdiv2',encodeURI(str),'myChartIdB2')

 

……………..

 

ajaxLink('chartdiv6',encodeURI(str),'myChartIdB6')

<BR style="mso-special-character: line-break"><BR style="mso-special-character: line-break">

 

I am generating chart in the above function by passing unique div and chart ids.

 

If I go for click on another segment on multipiechart it’s giving me the error like chartid is already exists so please rename it.

 

My worry is how I can generate unique chart ids for each segment of multipiechart?

 

As you suggested, I would like to dispose the old chart instances then I think it works for me

 

Please guide me how to dispose in my ajax function?

 

Thanks in advance

 

 

 

 

 

Thanks for your reply. where should i put the code which u send?

 

can i use that in jsp?

 

 

post-26544-0-72170200-1340719742_thumb.jpg

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

You would need to call this function before defining the FusionCharts instance.

 

Thus, it will dispose the chart ID, if the chart has been already rendered.

 

{

dataContainer.innerHTML = data;

if(FusionCharts("chartIDM")){
   FusionCharts("chartIDM").dispose();
}

var myAjax = new FusionCharts("AngularGauge.swf",chartIDM,"265", "135", "0", "0");

myAjax.setDataXML(data); 

myAjax.addParam("WMode", "Transparent"); 

myAjax.render(divID);

}

Share this post


Link to post
Share on other sites

its working.Thanks a lot. :)

 

Hi,

 

You would need to call this function before defining the FusionCharts instance.

 

Thus, it will dispose the chart ID, if the chart has been already rendered.

 

{

dataContainer.innerHTML = data;

if(FusionCharts("chartIDM")){
   FusionCharts("chartIDM").dispose();
}

var myAjax = new FusionCharts("AngularGauge.swf",chartIDM,"265", "135", "0", "0");

myAjax.setDataXML(data); 

myAjax.addParam("WMode", "Transparent"); 

myAjax.render(divID);

}

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