etm Report post Posted June 6, 2008 I am trying to create a simple usage of the Worldmap. If I follow and create an example and attempt to load from an XML file: this is what I see on my screen: If I place the XML inline, I can get the chart; however, I cannot get the MARKER link function to work. I even wrote a simple function in which I just try to alert a message. My javascript code is simple: And here is the XML: Why does the insertion of the file not interpret the XML correctly. Please note, I removed the link part of the one marker line to verify that was not causing the effect where a portion of the map shows. What can I do to use inline Javascript and have strings in the function. So if you have: link='JAVASCRIPT: loadPg('myStr');' Does not work. Tried: var myVar = 'myStr'; Then loading the function as follows: link='JAVASCRIPT: loadPg(myStr);' ? I'm at my wit's end with this one. Share this post Link to post Share on other sites
etm Report post Posted June 6, 2008 Please note, that the XML file does not have this string: map.setDataXML( at the start of the file. The string was only in my picture, because I had copied it from the web page where I was placing the strings inline while testing. Share this post Link to post Share on other sites
FusionCharts Support Report post Posted June 7, 2008 Hi, Could you please use map.setDataURL("map.xml") when you like to provide the XML from a file or XML stream? Could you please check whether you are placing the Map in a frame o iframe which might prevent the javascript function to execute? Share this post Link to post Share on other sites
etm Report post Posted June 9, 2008 I applied your XML example for the entity javascript and that works. I extended that code with the marker code. I'm still not having any luck with the javascript firing from the marker. See XML Below: <map borderColor='005879' fillColor='D7F4FF' numberSuffix=' Mill.' includeValueInLabels='1' labelSepChar=': ' baseFontSize='9'> <data> <entity id='NA' value='515' link="JavaScript:myJS('NA, 515');"/> <entity id='SA' value='373' link="JavaScript:myJS('SA, 373');"/> <entity id='AS' value='3875' link="JavaScript:myJS('AS, 3875');"/> <entity id='EU' value='727' link="JavaScript:myJS('EU, 727');"/> <entity id='AF' value='885' link="JavaScript:myJS('AF, 885');"/> <entity id='AU' value='32' link="JavaScript:myJS('AU, 32');"/> </data> <markers> <definition> <marker id='CAN' x='113.02' y='141' link="JavaScript: loadPg('CAN');" label='Canada' labelPos='left' /> <marker id='INC' x='135.52' y='172.5' link="Javascript: loadPg('INC');" label='Houston' labelPos='right' /> <marker id='SPL' x='335.02' y='121.5' link="Javascript: loadPg('SPL');" label='United Kingdom' labelPos='top' /> <marker id='SIN' x='560.02' y='267' link="Javascript: loadPg('SIN');" label='Singapore' labelPos='bottom' /> <marker id='DUB' x='446.02' y='202.5' link="Javascript: loadPg('DUB');" label='Dubai' labelPos='top' /> </definition> <application> <marker id='CAN' shapeId='triangle' /> <marker id='INC' shapeId='triangle' /> <marker id='SPL' shapeId='triangle' /> <marker id='SIN' shapeId='triangle' /> <marker id='DUB' shapeId='triangle' /> </application> </markers> </map> Share this post Link to post Share on other sites
etm Report post Posted June 9, 2008 Attached is the debugger code I got by turning on the debugger: Info: Map loaded and initialized. Version: 3.0.4 Map Objects: BACKGROUND PLOT LABELS LEGEND TOOLTIP MARKERS MARKERLABELS MARKERCONNECTORS Initial Width: 700 Initial Height: 300 Scale Mode: noScale Debug Mode: Yes Application Message Language: EN INFO: Map registered with external script. DOM Id of map is Map1Id INFO: XML Data provided using dataURL method. dataURL provided: map.xml dataURL invoked: map.xml XML Data: <map borderColor="005879" fillColor="D7F4FF" numberSuffix=" Mill." includeValueInLabels="1" labelSepChar=": " baseFontSize="9"><data><entity id="NA" value="515" link="JavaScript:myJS('NA, 515');" /><entity id="SA" value="373" link="JavaScript:myJS('SA, 373');" /><entity id="AS" value="3875" link="JavaScript:myJS('AS, 3875');" /><entity id="EU" value="727" link="JavaScript:myJS('EU, 727');" /><entity id="AF" value="885" link="JavaScript:myJS('AF, 885');" /><entity id="AU" value="32" link="JavaScript:myJS('AU, 32');" /></data><markers><definition><marker id="CAN" x="113.02" y="141" link="JavaScript: loadPg('CAN');" label="Canada" labelPos="left" /><marker id="INC" x="135.52" y="172.5" link="Javascript: loadPg('INC');" label="Houston" labelPos="right" /><marker id="SPL" x="335.02" y="121.5" link="Javascript: loadPg('SPL');" label="United Kingdom" labelPos="top" /><marker id="SIN" x="560.02" y="267" link="Javascript: loadPg('SIN');" label="Singapore" labelPos="bottom" /><marker id="DUB" x="446.02" y="202.5" link="Javascript: loadPg('DUB');" label="Dubai" labelPos="top" /></definition><application><marker id="CAN" shapeId="triangle" /><marker id="INC" shapeId="triangle" /><marker id="SPL" shapeId="triangle" /><marker id="SIN" shapeId="triangle" /><marker id="DUB" shapeId="triangle" /></application></markers></map> Share this post Link to post Share on other sites
etm Report post Posted June 9, 2008 Resolved. I was applying the link in the wrong section of the marker XML. After re-reading the documentation. Share this post Link to post Share on other sites
kgnanasekaran Report post Posted February 20, 2014 Hi Admin, We are also trying to implement similar feature in our reports i.e to open a popup when the user clicks on a marker circle. Is this possible? if yes can you please share the syntax. I tried giving like <marker id="AL" x="485.4" y="284.19" link="JavaScript: loadPg();" label="Test" labelpos="right" /> and, function loadPg() { alert("hi"); } but it is not firing anything. please help. Share this post Link to post Share on other sites