Sign in to follow this  
Gauri Bansode

How To Display Chart On Popup / Small Window From Javascript Function On Each Slice Of Pie Chart?

Recommended Posts

Hi,

 

I want to show the simple column chart on small pop up window when i click on each slice of pie chart.

I am displaying pie chart from my view.jsp page using dataXML method. and when i click on each slice i call javascript function on 'link' element.

Now in javascript function i have written required data for column chart to display and using 'window.open' i am trying to show that column chart,but its not working.

 

here is my code:

 

Pie chart

 

            	........
            	....... 
           	strXML1+="<set name='gauri'   value='10'   link='javascript:my()' />"; 
           	......
           	......

 


          	function my()
		  {
		    var dynDiv = document.createElement("div");
			dynDiv.id = "divDyna";
			dynDiv.innerHTML = "Created using JavaScript";
			dynDiv.style.height = "20px";
			dynDiv.style.width = "300px"; 	
			dynDiv.style.backgroundColor = 'gray';
   			var sampText= "testetetredfdsfsdf";


			<%
			 String str="";
			 str+="<graph caption='' xAxisName='' yAxisName='' decimalPrecision='0' formatNumberScale='0' >";
			 str+="<set name='Jan' value='7' color='AFD8F8'/>";
            	str+="<set name='Feb' value='6' color='AFD8F8'/>";
			 str+="</graph>";
			 %>


			 var chart1 = new FusionCharts("<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/FusionCharts/FCF_Column3D.swf")%>", "chart1Id", "240", "240");
			 chart1.setDataXML("<%=str%>");

			top.consoleRef=window.open('','myconsole','width=500,height=500')
			 top.consoleRef.document.writeln(
			  '<html><head><title>Console</title></head>'
			   +'<body>'
			   +chart1.render(dynDiv)+'</body></html>'
			 )


         	}

 

 

If anybody knows the solution please help me.

 

Thanks in advance.

 

Regards,

Gauri Bansode

Share this post


Link to post
Share on other sites

Hi,

 

I want to show the simple column chart on small pop up window when i click on each slice of pie chart.

I am displaying pie chart from my view.jsp page using dataXML method. and when i click on each slice i call javascript function on 'link' element.

Now in javascript function i have written required data for column chart to display and using 'window.open' i am trying to show that column chart,but its not working.

 

here is my code:

 

Pie chart

 

        		........
        		....... 
           	strXML1+="<set name='gauri'   value='10'   link='javascript:my()' />"; 
           	......
           	......

 


      		function my()
	  	{
	    	var dynDiv = document.createElement("div");
			dynDiv.id = "divDyna";
			dynDiv.innerHTML = "Created using JavaScript";
			dynDiv.style.height = "20px";
			dynDiv.style.width = "300px"; 	
			dynDiv.style.backgroundColor = 'gray';
   			var sampText= "testetetredfdsfsdf";


			<%
		     String str="";
		     str+="<graph caption='' xAxisName='' yAxisName='' decimalPrecision='0' formatNumberScale='0' >";
		     str+="<set name='Jan' value='7' color='AFD8F8'/>";
        		str+="<set name='Feb' value='6' color='AFD8F8'/>";
		     str+="</graph>";
		     %>


		     var chart1 = new FusionCharts("<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/FusionCharts/FCF_Column3D.swf")%>", "chart1Id", "240", "240");
		     chart1.setDataXML("<%=str%>");

			top.consoleRef=window.open('','myconsole','width=500,height=500')
		     top.consoleRef.document.writeln(
		  	'<html><head><title>Console</title></head>'
		       +'<body>'
		       +chart1.render(dynDiv)+'</body></html>'
		     )


         	}

 

 

If anybody knows the solution please help me.

 

Thanks in advance.

 

Regards,

Gauri Bansode

 

 

 

I am sorry that i have posted this thread in wrong a section as i am using FusionCharts free version.

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