Solved

CFCHART help needed; table cell contains an array

Posted on 2004-10-14
7
337 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove Index.php in Codeigniter 12 56
Finding an Azure real-time monitoring dashboard 2 59
Connect to MS-SQL server from Linux/PHP 8 81
System Analysis 5 51
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now