Armand du Toit Report post Posted May 3, 2012 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 Report post Posted May 4, 2012 (edited) 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 May 4, 2012 by Bindhu Share this post Link to post Share on other sites
Armand du Toit Report post Posted May 4, 2012 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 On 5/4/2012 at 6:32 AM, Bindhu said: 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 Report post Posted May 5, 2012 Hi, We are glad to hear that your issue has been resolved. Happy FusionCharting. Share this post Link to post Share on other sites