Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFCHART help needed; table cell contains an array

Posted on 2004-10-14
7
Medium Priority
?
370 Views
Last Modified: 2013-12-24
This is what I have:

<cfquery name="chartdata" datasource="survey">
SELECT surveyqst.answers, results#getques.surveyID#.q#getques.quesnum#
FROM surveyqst, results#getques.surveyID#
WHERE surveyID = #getques.surveyID#
</cfquery>
<center>
<cfchart format="flash" chartheight="200" chartwidth="400" showborder="yes" show3d="yes" tipstyle="mouseOver" pieslicestyle="sliced">
<cfchartseries type="pie" query="chartdata" itemcolumn="answers" valuecolumn="q#getques.quesnum#" />
</cfchart>
</center>

I need the legend to contain the possible answers such as Agree, Somewhat Agree, etc. These are currently stored in a single cell as an array. The column is answers, but each row contains the answers to a different question. Any help would be greatly appreciated.

Thanks!
Jenny
0
Comment
Question by:jenny_devine
7 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 12308493
This is good exmple of the limitation of the ColdFusion CFCHART.
You have no control over the legend.
If you want to disaply some legend then you will have to give the exact name as the column what you want to dispaly.
In summery, change hte name of the column, there is no other way.

When the scenario like you have when there is array in your table cell, I can not imagine, how mcuh complex it would be and CFCHART will be not capable to handle this scenario. I have submitted this as suggestion when I was beta testing the new CF coming out in 2005 code name 'blackstone'.

regards,
---Pinal
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12309433
You may want to try creting your own legend and displaying that below the chart.
0
 

Author Comment

by:jenny_devine
ID: 12310232
I shouldn't have mentioned the legend. The cfchart tag creates the legend automatically based on the itemcolumn. What we are in the process of doing is using Hal Helm's custom tag: cf_querysim (http://www.halhelms.com/index.cfm?fuseaction=code.detail) and actually looping through the variables to fill in the cf_querysim parameters. It's working pretty well so far. We've got a few bugs to work out, but here is what we have so far:

<cf_querysim>
 chartdata
 possibleanswers,answers
<cfloop list="#getques.answers#" index="i">#i#|<cfset x=0><cfloop query="total"><cfif i IS Evaluate("q" & getques.quesnum)><cfset x=x+1><cfelse></cfif></cfloop>#x#
</cfloop>
</cf_querysim>

<center>
<cfchart format="flash" chartheight="300" chartwidth="500" showborder="yes" show3d="yes" tipstyle="mouseOver" pieslicestyle="sliced">
<cfchartseries type="pie" query="chartdata" itemcolumn="possibleanswers" valuecolumn="answers" />
</cfchart>
</center>
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 35

Expert Comment

by:mrichmon
ID: 12310247
So then what is the question?
0
 

Author Comment

by:jenny_devine
ID: 12310723
Basically, we solved it ourselves and I was sharing the answer.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12591844
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question