anila

Need to call js function on entire chart.

Recommended Posts

Hi,

Thanks alot for your reply and sample code.

function download(feed,ctl){
 alert('inside download...');
 var form  = document.forms[0];
   form.method="POST";
   form.action="ExtDXAction.do?type="+feed+"&cn="+ctl;
   form.submit();
 }

From js function i am forwarding request to one servlet.

May be this is the prblm? not sure

If I removed hilighted code from js.

then its working perfect.

Share this post


Link to post
Share on other sites

Hi Anila,

If you need to call the servlet, then , you can get rid of the javasript function and do something like this:

 
// Encoding the URL since it has a parameter
strDataURL = FusionChartsHelper.encodeDataURL("servlet.do?FactoryId="+factoryId,"false",response);

then use this strDataURL in clickURL directly.

Srividya

Share this post


Link to post
Share on other sites

Hi,

Can u explain me briefly.

 String chartXML1 = "<chart clickURL='javascript:download(%26apos;DwnNPS%26apos;,4);' labelDisplay='Rotate' slantLabels='1' baseFont='Ge Inspira' useRoundEdges='1' legendPosition='RIGHT' yAxisName='NPS' legendBorderAlpha='0' shownames='1' showvalues='0'>"; 
			  String chartCatge1 ="<categories>"+str2;
			  String chartCat1=str3;
						   
		    chartCatge1 = chartCatge1 +"</categories>";
		    String strXML1=chartXML1+chartCatge1+chartCat1+"</chart>";
			 System.out.println ("STRING XML :"+strXML1);
			  //Create the chart - Column 3D Chart with data contained in strXML1
		    String chartCode1= createChart("design/js/FusionCharts/MSLine.swf","", strXML1,"nps2", 490, 200, false,true);
		    

I am rendering chart like this

<div id="3" ><font face="GE Inspira" size="2" onclick="download('DwnNPS',4)" style="cursor:hand"><b><%=Block4_heading%></b></font>
															    <%=chartCode1%> </div>   

i have the javascript function which i was posted before.

Share this post


Link to post
Share on other sites

Hi,

 String feed="DWNNPS";
			    int ctl=4;
	   String strURL =encodeDataURL("ExtDXAction.do?type="+feed+"&cn="+ctl,"false",response);
			  String chartXML1 = "<chart clickURL='"+strURL+"' labelDisplay='Rotate' slantLabels='1' baseFont='Ge Inspira' useRoundEdges='1' legendPosition='RIGHT' yAxisName='NPS' legendBorderAlpha='0' shownames='1' showvalues='0'>"; 
			  String chartCatge1 ="<categories>"+str2;
			  String chartCat1=str3;

I tried to use somethng like above code.

I am getting  invalid xml data.

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

here is the code

  String feed="DWNNPS";
			    int ctl=4;
			    String strURL =encodeDataURL("ExtDXAction.do?type="+feed+"&cn="+ctl,"false",response);
//clickURL='javascript:download(%26apos;DwnNPS%26apos;,4);'
			  String chartXML1 = "<chart  clickURL='"+strURL+"' labelDisplay='Rotate' slantLabels='1' baseFont='Ge Inspira' useRoundEdges='1' legendPosition='RIGHT' yAxisName='NPS' legendBorderAlpha='0' shownames='1' showvalues='0'>"; 
			  String chartCatge1 ="<categories>"+str2;
			  String chartCat1=str3;
			  /*for(int head1=0;head1<nps1.size();head1++)
		  {
			  chartCatge1 = chartCatge1 + "<category label='"+nps1.get(head1)+"'/>";
		  }*/
		  
		    chartCatge1 = chartCatge1 +"</categories>";
		    String strXML1=chartXML1+chartCatge1+chartCat1+"</chart>";
			 System.out.println ("STRING XML :"+strXML1);
			  //Create the chart - Column 3D Chart with data contained in strXML1
		    String chartCode1= createChart("design/js/FusionCharts/MSLine.swf","", strXML1,"nps2", 490, 200, false,true);
		   // System.out.println ("CHART CODE :"+chartCode1);

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

I came to know one reason why it is showing INVALID XML DATA.

tat is as part servlet request i used & after tat i replaced wth &.

If i copy the code in IE xml is generating.

For same code in FS,its throwing INVALID XML DATA.

I am wondering,wats going wrong?

Wat is the prblm?

<chart clickURL='ExtDXAction.do?type=DWNNPS&cn=4' labelDisplay='Rotate' slantLabels='1' baseFont='Ge Inspira' useRoundEdges='1' legendPosition='RIGHT' yAxisName='NPS' legendBorderAlpha='0' shownames='1' showvalues='0'><categories><category label='Jul-2008'/><category label='Aug-2008'/><category label='Sep-2008'/><category label='Oct-2008'/><category label='Nov-2008'/><category label='Dec-2008'/><category label='Mar-2009'/><category label='Jun-2009'/></categories><dataset seriesName='P-TECH'><set value='77.0'/><set value='64.0'/><set value='38.0'/><set value='81.0'/><set value='86.0'/><set value='80.0'/><set value='95.0'/><set value='69.0'/></dataset><dataset seriesName='LUNAR'><set value='100.0'/></dataset><dataset seriesName='CARDIAC'><set value='62.0'/><set value='78.0'/><set value='54.0'/><set value='68.0'/><set value='78.0'/><set value='69.0'/><set value='73.0'/><set value='61.0'/></dataset><dataset seriesName='MULTIVENDOR'><set value='63.0'/><set value='71.0'/><set value='44.0'/><set value='66.0'/><set value='79.0'/><set value='67.0'/><set value='80.0'/><set value='77.0'/></dataset><dataset seriesName='NETWORKING'><set value='46.0'/><set value='58.0'/><set value='57.0'/><set value='51.0'/><set value='77.0'/><set value='83.0'/><set value='78.0'/><set value='51.0'/></dataset><dataset seriesName='DU- IT'><set value='78.0'/><set value='78.0'/><set value='69.0'/><set value='80.0'/><set value='77.0'/><set value='83.0'/><set value='77.0'/><set value='84.0'/></dataset></chart>

Edited by Guest

Share this post


Link to post
Share on other sites

Hi All,

Thanks alot for your guidelines.

Finally i got solution for the problem.

Insted of &,i used %26.

Now its working.

Rocking.....Thanks to all once again......

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