pariyani Report post Posted July 16, 2010 (edited) Hi, Is there a way to get entity values (including short name, long name, id) by clicking on a map entity using javascript? For example, Lets say I click on the State of Texas on a US map and an alert box pops up saying "You clicked on Texas (TX) , Value='1234', entity ID='TX'." I am sure this is easy but I couldn't find a solution in the forums. Can someone please help with this or point to a link where a similar query is addressed? *update: The DB Schema does not have Long Names stored for any entity so that is not an option.* Thanks. Edited July 16, 2010 by Guest Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted July 19, 2010 Hi, In this case you need to use your own code in javascript so that it returns the entity values. Ref.- <set label='USA' value='235' link="j-myJS-NA,235"/> <SCRIPT LANGUAGE="JavaScript"> <!-- function myJS(myVar){ window.alert(myVar); } //--> </SCRIPT> Hope this helps. Share this post Link to post Share on other sites
pariyani Report post Posted July 19, 2010 (edited) Hey, Thanks for the Code, but that was not what I was asking for. I specifically wanted to pull out long and short names of a map entity from the map object itself. Anyways, I found the solution. The code is as follows: In the chart XML: <entity id='123' value='500' link='j-getEntityData-123'/> //javascript Code function getEntityData(id) { var map1 = getMapFromId("mapid"); var entities = map1.getEntityList();// var lName = ""; var sName = ""; for (i = 1; i < entities.length; i++) { if (entities.id == id) lName= entities.lName; sName= entities.sName; } alert("Long Name: "+ lName +", Short Name: "+sName); } Please let me know if there is a better solution than this. Thanks. Edited July 19, 2010 by Guest Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted July 20, 2010 Hi, We are glad that your issue is resolved. Thanks for sharing your idea. Keep smiling and keep FusionCharting. Share this post Link to post Share on other sites