Sign in to follow this  
FusionCharts Support

Multiple Pie3D charts

Recommended Posts

I want to show 4 charts on a same page, eah one in a different DIV. I have the Query running, and as far i can see, the XML is beign properly made using concatenation.

 

 

 

The thing is I am using one method (imprimechart) to populate each chart (I use a string to see witch chart I am building). I think the code generating the XML is correct, but i still get the "chart" text on all DIVs.

 

 

 

Here's the code on the aspx page

 

 

 

< div style="z-index: 106; left: 56px; width: 250px; position: absolute; top: 88px;

           height: 250px" id="P1-P2">

           < % = imprimeChart("P1-P2") %>            

       < /div>

       < div style="z-index: 107; left: 320px; width: 250px; position: absolute; top: 88px;

           height: 250px" id="P2-P3">

           < % = imprimeChart("P2-P3") %>

       < /div>

       < div id="P3-P4" style="z-index: 108; left: 56px; width: 250px; position: absolute;

           top: 352px; height: 250px">

           < % = imprimeChart("P3-P4") %>

       < /div>

       < div id="P2-P5" style="z-index: 109; left: 320px; width: 250px; position: absolute;

           top: 352px; height: 250px">

           < % = imprimeChart("P2-P5") %>

       < /div>

 

 

 

and the CS code

 

 

 

public string imprimeChart(string Div)

 

{

 

string dataXML = "< chart caption='" + Div + "' formatNumberScale='0'>";

 

int columna = 0,criterio = 0, buenos = 0, malos = 0;

 

 

 

switch (Div)

 

{

 

case "P1-P2":

 

columna = 2;

 

criterio = 5;

 

break;

 

case "P2-P3":

 

columna = 3;

 

criterio = 17;

 

break;

 

case "P2-P4":

 

columna = 4;

 

criterio = 20;

 

break;

 

case "P2-P5":

 

columna = 5;

 

criterio = 25;

 

break;

 

}

 

 

 

//ve cada fila de la columna elegida para el gr

Edited by Guest

Share this post


Link to post
Share on other sites

Hi

 

 

 

I checked the code but I do have the 'script language="JavaScript" src="FusionCharts/FusionCharts.js" /script' in the Head tag of the page. Also I checked with sample data to see if the problem could be the XML was sending charts with no data inside, but still I get the 'Chart' text on each Div... not even the 'no data to display' message.

Share this post


Link to post
Share on other sites

hi,

I have a quick view of your code and i trapped some javascript errors. The div ids that you have defined are having '-' character which is not permissible in JavaScript. can you please replace the character with say, '_' and things will work.

e.g.

<div style="z-index: 106; left: 56px; width: 250px; position: absolute; top: 88px;

  height: 250px" id="P1_P2">

  <% = imprimeChart("P1_P2") %>

</div>

Moreover, the size of the chart are bigger (600x300) than the container (250x250). Please set the size of the charts too:

return FusionCharts.RenderChart("FusionCharts/Pie3D.swf", "", dataXML, Div, "250", "250", false, false);

Share this post


Link to post
Share on other sites

I made the change on the DIV's IDs and voila! the charts worked wonderfully!

 

 

 

I can't believe something that simple kept me stucked this long... better go hit some books 'bout javascript :)

 

 

 

thanks for your help, you guys really rock !

 

 

 

Just a lttle concern. I don't know why the first chart loks normal while the others 3 the pie is a lot smaller than the first one... but they're visible...

Edited by Guest

Share this post


Link to post
Share on other sites

Here are the ss for the chars.

Pie3D.jpg

Pie2D.jpg

Column2D.jpg

As you can see, the problem appears on the 2D and 3D pie charts, while in the 2D Column (I haven't tested with the 3D column) you can't see a major size difference.

Also, if you pay attention, the Pie charts seems to become smaller in the order they are plotted (it's more visible on the 2D pie rather than the 3D).

Share this post


Link to post
Share on other sites

Hi,

 

 

 

For the pie and doughnut charts, the size is determined by the empty space on chart (left after rendering labels). If you want to force your own size of the pie/doughnut, you can set:

 

[ chart ... pieRadius='xx' ...] (xx in pixels)

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