Solved

CFCHART help needed; table cell contains an array

Posted on 2004-10-14
7
328 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
Comment Utility
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
Comment Utility
You may want to try creting your own legend and displaying that below the chart.
0
 

Author Comment

by:jenny_devine
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 35

Expert Comment

by:mrichmon
Comment Utility
So then what is the question?
0
 

Author Comment

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

Accepted Solution

by:
modulo earned 0 total points
Comment Utility
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 …
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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