Sign in to follow this  
kaiwachter

how to provide Javascript link in Setdatxml Method

Recommended Posts

Hi Guys,

i have problem in implementing dynamic Drill Down Maps. Below is the script i am trying to overhand to the map. the user should be able click on a country. due to server limitations it is not possible to have a static XML File like described in you how-to.

<script type="text/javascript">

var chart1 = new FusionMaps("/sap/bw/mime/customer/ibs/maps/FCMap_Europe.swf", "WEBITEM_2", "635", "452", "0", "0");

chart1.setDataXML("<Map animation='0' showLables='1' includeNameInLabels='1' includeValueInLabels='0' showShadow='1' showBevel='1' defaultAnimation='1'><data><entity  value='4687' id='014' color='' link="WEB_ITEM_1_DrillDownForChar('DE','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='844' id='014' color='' link="WEB_ITEM_1_DrillDownForChar('DI','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='5113' id='010' color='' link="WEB_ITEM_1_DrillDownForChar('DK','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='740' id='010' color='' link="WEB_ITEM_1_DrillDownForChar('DO','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='5130' id='038' color='' link="WEB_ITEM_1_DrillDownForChar('ES','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='568' id='013' color='' link="WEB_ITEM_1_DrillDownForChar('FR','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='4889' id='019' color='' link="WEB_ITEM_1_DrillDownForChar('IT','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='922' id='019' color='' link="WEB_ITEM_1_DrillDownForChar('MI','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='975' id='028' color='' link="WEB_ITEM_1_DrillDownForChar('MO','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='4625' id='029' color='' link="WEB_ITEM_1_DrillDownForChar('NL','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='4347' id='031' color='' link="WEB_ITEM_1_DrillDownForChar('PL','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='4737' id='046' color='' link="WEB_ITEM_1_DrillDownForChar('RU','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='606' id='046' color='' link="WEB_ITEM_1_DrillDownForChar('SA','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='4503' id='039' color='' link="WEB_ITEM_1_DrillDownForChar('SE','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='595' id='039' color='' link="WEB_ITEM_1_DrillDownForChar('SO','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='3961' id='042' color='' link="WEB_ITEM_1_DrillDownForChar('UK','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /><entity  value='47242' id='042' color='' link="WEB_ITEM_1_DrillDownForChar('Overall Result','OD_REGION','DATAPROVIDER_2','OD_COUNTRY','FCMap_Germany.swf');" /></data><colorRange><color minValue='0' maxValue='600' DisplayValue='Lower than requested' color='FF0000' /><color minValue='600' maxValue='1000' DisplayValue='Less than Middle' color='FFC0C0' /><color minValue='1000' maxValue='4000' DisplayValue='Middle Bound' color='FF8000' /><color minValue='4000' maxValue='5000' DisplayValue='Okay' color='80FF80' /><color minValue='6000' maxValue='10000' DisplayValue='Excellent' color='00C000' /></colorRange></Map>");

chart1.render("divWEBITEM_2");</script>

but unfortunatelly the resulting HTML page results in Javascript errors. It mus be somehow escaped. Please assist.

best regards,

Kai Wachter

Share this post


Link to post
Share on other sites

Kai,

In dataURL method, you do NOT need to build physical XMLs. You can virtually relay them to chart - like set dataURL=Data.asp

In data.asp, build the XML in a string and do Response.Write(strXML) or print strXML in PHP

Share this post


Link to post
Share on other sites

Hi pallav,

due to the restrictions of the environment i am working with i need to provide the XML. But i fixed that problem on my own by escaping the " in Link with ". This works fine.

best regards,

Kai Wachter 

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