Sign in to follow this  
tstreeter

Chart Scaling - Pie2d

Recommended Posts

Ran into an issue when dsiplaying 2 Pie2d side by side.

Even though the chart size is exactly the same. When the chart is drawn, it's taking the label names/values as precedent and makes the chart larger or smaller depending on the labels and values.

The result is 2 charts with the same labels but differenet values is dsiplayed in 2 sizes.

If I turn the values off. The charts are the same size.

Is there any way to force the code to set the space required for labels/values to taker a lower precedent and have the chart be sized first and than have the labels/values use the remaining space?

Please see screenshot for example

Here is the code.

<%

 'In this example, we show how to connect FusionCharts to a database.

 'For the sake of ease, we've used an Access database which is present in

 '../DB/FactoryDB.mdb. It just contains two tables, which are linked to each

 'other.

 

 'Database Objects - Initialization

 Dim oRs, oRs2, strQuery

 'strXML will be used to store the entire XML document generated

 Dim strXML

 

 'Create the recordset to retrieve data

 Set oRs = Server.CreateObject("ADODB.Recordset")

 'Generate the chart element

 

 

 strXML = "<chart caption='Count of Open Records by Queue Type HFD' subcaption='Previous Day (Click on Chart for Detail)' showlabels='1' showvalues='1' showBorder='0' formatNumberScale='0' slantLabels='0' useRoundEdges='1' skipOverlapLabels='0' clickurl='f-main-http://cskdev03/ccx/FusionCharts/FusionCharts_Evaluation/Code/ASP/DBExample/eBins_HFD_QN_Open.asp'>" 

'Iterate

 strQuery = "select * from QT_Open_HFD_Master"

 Set oRs = oConn.Execute(strQuery)

 

 While Not oRs.Eof

'Now create second recordset to get details for this factory

Set oRs2 = Server.CreateObject("ADODB.Recordset")

strQuery = "select sum(countofactivityid) as TotOutput from QT_Open_HFD_Output where Graph_ID=" & ors("Graph_ID")

Set oRs2 = oConn.Execute(strQuery)

'Generate <set label='..' value='..' />

strXML = strXML & "<set label='" & ors("QueueType") & "' value='" & ors2("TotOutput") & "' />"

'Close recordset

Set oRs2 = Nothing

oRs.MoveNext

 Wend

 'Finally, close <chart> element

 strXML = strXML & "</chart>"

 Set oRs = nothing

 

 'Create the chart - Pie 3D Chart with data from strXML

 Call renderChart("../../FusionCharts/pie2d.swf", "", strXML, "Chart_1", 400, 330, false, false)

%></td>

<td><% 

 

 'Create the recordset to retrieve data

 Set oRs = Server.CreateObject("ADODB.Recordset")

 

 

 

 strXML = "<chart caption='Count of Closed Records by Queue Type HFD' subcaption='Previous Day (Click on Chart for Detail)' showlabels='1' showvalues='1' showBorder='0' formatNumberScale='0' slantLabels='0' useRoundEdges='1' skipOverlapLabels='0' clickurl='f-main-http://cskdev03/ccx/FusionCharts/FusionCharts_Evaluation/Code/ASP/DBExample/eBins_HFD_QN_Closed.asp'>"

 

 'Iterate through each factory

 strQuery = "select * from QT_Closed_HFD_Master"

 Set oRs = oConn.Execute(strQuery)

 

 While Not oRs.Eof

'Now create second recordset to get details for this factory

Set oRs2 = Server.CreateObject("ADODB.Recordset")

strQuery = "select sum(countofqueue_name) as TotOutput from QT_Closed_HFD_Output where Graph_ID=" & ors("Graph_ID")

Set oRs2 = oConn.Execute(strQuery)

'Generate <set label='..' value='..' />

strXML = strXML & "<set label='" & ors("QueueType") & "' value='" & ors2("TotOutput") & "' />"

'Close recordset

Set oRs2 = Nothing

oRs.MoveNext

 Wend

 'Finally, close <chart> element

 strXML = strXML & "</chart>"

 Set oRs = nothing

 

 

 Call renderChart("../../FusionCharts/pie2d.swf", "", strXML, "Chart_2", 400, 330, false, false)

post-893-128441567997_thumb.jpg

Share this post


Link to post
Share on other sites

hi,

 Could you please try chart's  pieRadius attribute to set and fix the radius of the pie Chart?

eg. <chart  pieRadius='40' > or <chart pieRadius='60' >

pieRadius Number In Pixels

This attribute lets you explicitly set the outer radius of the chart. FusionCharts automatically calculates the best fit pie radius for the chart. This attribute is useful if you want to enforce one of your own values.

 

Share this post


Link to post
Share on other sites

Worked perfectly...thanks for the quick response.

Another question...Is there a reference for all the switches to the charts in the documentation? I looked at the reference for the Chart Elements and did not see this one listed.

I'm using the full version.

Thanks

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