Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank cfchart

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

I'm learning to develop using Coldfusion MX and have constructed a simple poll adapted from an online tutorial. At present I know my queries are correct as I am using cfdump to output them. However, when I try to output these queries as a pie chart I just get a 600x400 lump of white space. When I right-click the white space I get a Flash specific local menu so I know it's getting half-way there!

Does anyone have any ideas?
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en" lang="en">
<head>
  <title>Poll Results</title>
</head>
<body>
  <!--- Ensure parameters passed are all defined --->
  ...
  <!--- Retrieve database data --->
  ...
  <cfquery name="BananaListMethod0" datasource="examplesource">
    SELECT BananaPeelMethod, COUNT(*) AS method0_count
    FROM banana_peeling
    WHERE BananaPeelMethod = 0
    GROUP BY BananaPeelMethod;
  </cfquery>

  <cfquery name="BananaListMethod1" datasource="examplesource">
    SELECT BananaPeelMethod, COUNT(*) AS method1_count
    FROM banana_peeling
    WHERE BananaPeelMethod = 1
    GROUP BY BananaPeelMethod;
  </cfquery>

  <!--- page heading --->
  ...
  <cfoutput>
    <!--- echo chosen form value back to user --->
    ...
    There are #get_results.recordcount# people who peel a banana the way you do!
    <br />
    <!--- show results as a pie chart --->
    [Begin Chart]
    <cfchart showborder="yes" show3d="yes" chartwidth="600"  chartheight="400"  pieslicestyle="sliced">
      <cfchartseries type="pie" query="BananaListMethod0" itemcolumn="BananaPeelMethod" valuecolumn="method0_count">
        <cfchartdata item="Method 1" value="#BananaListMethod1.method1_count#">
      </cfchartseries>
    </cfchart>
    [End Chart]
    <br />
    <hr size="1" noshade>
    <cfdump var="#BananaListMethod0#" label="Number of Method 0 Peelers"><br />
    <cfdump var="#BananaListMethod1#" label="Number of Method 1 Peelers"><br />
  </cfoutput>
</body>
</html>
(P.S. Try not to laugh as its a rather comical example.)

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
one tricky part is if the values that are being displayed in the
<cfchart chartheight="600" chartwidth="850" seriesplacement="cluster" show3d="yes" xoffset="0.01"
yoffset="0.03" fontsize="7" fontbold="yes" databackgroundcolor="DDDDDD" scaleto="500" gridlines="5"
showxgridlines="yes" showygridlines="yes">

the serieslabel sometimes takes all the space and doesn't show the pie chart itself. so, could you make the chart size bigger to see if it fixes the problem?
the above code works perfect for me...
hope it helps

 
Thanks for your response FALCONSEYE, but I still have an empty space even using your code. When I right-click the chart the following 2 options are available:
[ul square]
[li]Movie not loaded... (greyed out)[/li]
[li]About Macromedia Flash Player 7[/li]
[/ul]

I'm pretty sure it's not a code problem now. Is there any specific setting that I need to check on the CF Server?

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
You're problem sounds a little different but try this thread and see if it helps at all
thread232-910973

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top