Solved

CFCHART help needed; table cell contains an array

Posted on 2004-10-14
7
345 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 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