Sign in to follow this  
Pallav

Pie3D 2D view

Recommended Posts

Is there an api available that will enable me to change the 3D pie chart to its 2D view? If you right click on the 3d pie, there is a 2d option. I would like to toggle this with javascript if possible to give my users better print formatting. I could also regenerate the xml and re-render if an xml attribute could toggle this.

 

 

 

Does anything like this exist?

 

Thanks!

Share this post


Link to post
Share on other sites

I use JS and AJAX to create graphs like this...

function disp_charts(myxml){
	    mytype = document.getElementById('chart_type').value;   
    var myChart = new FusionCharts("myurl/FusionCharts/" + mytype, "myChart", mywidth, myheight);
    myChart.setDataXML(escape(myxml));
    myChart.render("report_chart");
    gXML = myxml;
}

So the ajax call is made, which returns the XML and draws the chart, i then store the returned xml in gXML.

So on my user interface I have a select list for ZOOM function , you'll notice the global vars mywidth & myheight.

I then use the following onchange event for the zoom selector tool....

// Zoom Graph
function zoom(per){
   
   mywidth= 900;
   myheight = 400;
   
   mywidth = mywidth * per;
   myheight = myheight * per;
   
   mytype = document.getElementById('chart_type').value;   
    if(mytype.match("Pie") != null || mytype.match("Dough") != null){
    
    if(mytype.match("FCF_Pie3D") != null){	  
		    pRad = 300;
    }				  
    else{
		    pRad = 150;
    }			    
	    var oVal = cPer * pRad;
    var nVal = per * pRad;
    
    cPer = per;
					    
    gXML = gXML.replace("pieRadius='"+oVal+"'","pieRadius='"+nVal+"'");
    } 
    var myChart = new FusionCharts("myurl/FusionCharts/" + mytype, "myChart", mywidth, myheight);
   myChart.setDataXML(escape(gXML));
   myChart.render("report_chart");    
}

You will notice i've had to deal with pie charts and the fact that 2d & 3d use different sizes for radius.

So you could possibly use this logic to enable 're-rendering' of charts with a different chart type via an onchange event  select list.

Hope this helps.

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