Solved

CFCHART help needed; table cell contains an array

Posted on 2004-10-14
7
363 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
What You Need to Know when Searching for a Webhost Provider
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 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