pri_dev
pri_dev

Reputation: 11645

drill down feature - call to a js function not working in fusioncharts

I am invoking a javascript function for drilling down the chart. I tried using both methods specified:

1) <set label='USA' value='235' link="j-myJS-empid"/>.

2) <set label='S. Korea' value='86' link="JavaScript:myJS('empid');"/>

the first try gives me error that the resource - /myapp/mychart/j-myJS-empid is unavailable. The second one just doesnot display the chart , says invalid XML data.

I am using grails-groovy (java based) to develop my application. I am using the dataXML method to generate the charts like this

<OBJECT style="z-index: -100" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" align="center" name="Column3D" width="440" height="350"
 codebase="http:/download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="Column3D">
 <param name="movie" value="/gra/swf/FCF_Column3D.swf" />
 <param name="FlashVars" value="&dataXML=${dataXML}" />
 <param name="quality" value="high" />
  <param name="wmode" value="transparent" />
 <param name="alpha" value="20" />
 <param name="blendMode" value="BlendMode.ALPHA" />

      <embed src="/gra/swf/FCF_Column3D.swf" style="text-align: center" flashVars="&dataXML=${dataXML}"
       quality="high" width="440" height="350" name="Column3D" type="application/x-shockwave-flash"
       pluginspage="http://www.macromedia.com/go/getflashplayer" />
      </object>

IS the javascript function cal supported only through dataURL method, if yes, I need to know if there is any other way to call a js function using dataXML method since I have many charts on the page and it wont be feasible to write the data to XML file for all. Also I wanted to know if there is a limit on the length of the URL specified in the link attribute P.S. I have succesfully invoked the JS call in my other chart where I use the dataURL method. Please hel is needed urgently. Thanks in advance Priyank

Upvotes: 0

Views: 1429

Answers (1)

sudipto
sudipto

Reputation: 2482

j- link format does not work in FusionCharts FREE.

For this you would need to use FusionCharts v3 ( http://www.fusioncharts.com/ )

JavaScript function call is supported through both DataXML and DataURL method.

Hope you might have already gone through this :

http://www.fusioncharts.com/free/docs/Contents/DrillDown/JavaScript.html

In case you are using DataXML method, your the quotes in your link needs to be URLEncoded:

Try:

link='JavaScript:myJS(%26quot;empid%26quot;);'

or

link='JavaScript:myJS(%26apos;empid%26apos;);'

Upvotes: 2

Related Questions