Sign in to follow this  
Armand du Toit

Multiple Links

Recommended Posts

Hi,

 

I'm using FusionCharts XT 3.2.2.

 

I am trying to configure a drill down chart. When a link is clicked, I want to open a new chart using "newchart-xml-???" in the link, but also call a custom javascript function when the same link is clicked. In other words, I would like to execute a javascript function passing it the linked chart id as soon as the linked chart has loaded.

 

I tried it using:

 

 

<chart>

 

<set label="aaa" value="111" link="newchart-xml-111 JavaScript: isJavaScriptCall=true; myJSFunction(111);" />

 

</chart>

 

or:

 

<chart>

 

<set label="aaa" value="111" link="newchart-xml-111" link="JavaScript: isJavaScriptCall=true; myJSFunction(111);" />

 

</chart>

 

Obviousy these methods do not work.

 

Could someone please advise me on how to do this? Is it possible?

 

Thanks!

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

If you want to call a custom JavaScript method when once the linked chart is rendered, then you may try using the 'LinkedItemOpened' event.

 

FusionCharts JavaScript class raises a number of events when LinkedCharts are in action.

 

Each link-invoking chart instance (that is, the parent chart) can listen to the events and can add more functionality to the implementation.

 

The events are as follows:

1. BeforeLinkedItemOpen : Fires before a LinkedChart item (descendant chart) is created

2. LinkedItemOpened : Fires after a LinkedChart item or descendant chart is created

3. BeforeLinkItemClose : Fires before a LinkedChart item or descendant chart is closed

4. LinkedItemClosed : Fires after a LinkedChart item or descendant chart is closed

 

Ref. Code:

FusionCharts("myChartId").addEventListener(
                 "LinkedItemOpened", function (eo, ao) { 
       	alert( 'Successfully drilled-down to a detailed chart.'); 
   	} 
 );

 

For more details on 'Creating LinkedCharts', please refer to the link below,

http://docs.fusioncharts.com/charts/contents/?JavaScript/JS_LinkedCharts.html

 

Hope this helps !

Edited by Bindhu

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the help. Funny thing is that I tried the same procedure late yesterday and it worked for me. Your post confirms that it is the way to do it.

 

Regards

 

Armand

 

 

 

Hi,

 

If you want to call a custom JavaScript method when once the linked chart is rendered, then you may try using the 'LinkedItemOpened' event.

 

FusionCharts JavaScript class raises a number of events when LinkedCharts are in action.

 

Each link-invoking chart instance (that is, the parent chart) can listen to the events and can add more functionality to the implementation.

 

The events are as follows:

1. BeforeLinkedItemOpen : Fires before a LinkedChart item (descendant chart) is created

2. LinkedItemOpened : Fires after a LinkedChart item or descendant chart is created

3. BeforeLinkItemClose : Fires before a LinkedChart item or descendant chart is closed

4. LinkedItemClosed : Fires after a LinkedChart item or descendant chart is closed

 

Ref. Code:

FusionCharts("myChartId").addEventListener(
                 "LinkedItemOpened", function (eo, ao) { 
           alert( 'Successfully drilled-down to a detailed chart.'); 
       } 
 );

 

For more details on 'Creating LinkedCharts', please refer to the link below,

http://docs.fusionch...nkedCharts.html

 

Hope this helps !

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

We are glad to hear that your issue has been resolved.

 

Happy FusionCharting.:D

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