Jump to content


Removing Chartid


  • Please log in to reply
6 replies to this topic

#1 ganiganesh

ganiganesh

    Advanced Member

  • Members
  • PipPipPipPip
  • 38 posts

Posted 26 June 2012 - 11:42 AM

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





#2 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1950 posts
  • LocationBangalore

Posted 26 June 2012 - 12:35 PM

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();
Thanks,
Sumedh

Follow us @Twitter!

#3 ganiganesh

ganiganesh

    Advanced Member

  • Members
  • PipPipPipPip
  • 38 posts

Posted 26 June 2012 - 12:47 PM

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();



#4 ganiganesh

ganiganesh

    Advanced Member

  • Members
  • PipPipPipPip
  • 38 posts

Posted 26 June 2012 - 02:09 PM

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?


Attached Thumbnails

  • FusionCharts.JPG


#5 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1950 posts
  • LocationBangalore

Posted 27 June 2012 - 06:20 AM

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);

}

Thanks,
Sumedh

Follow us @Twitter!

#6 ganiganesh

ganiganesh

    Advanced Member

  • Members
  • PipPipPipPip
  • 38 posts

Posted 27 June 2012 - 07:00 AM

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);

}



#7 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1950 posts
  • LocationBangalore

Posted 27 June 2012 - 07:16 AM

its working.Thanks a lot. :)



Posted Image
Thanks,
Sumedh

Follow us @Twitter!