?
Solved

CFCHART or CFGRAPH

Posted on 2005-03-18
10
Medium Priority
?
465 Views
Last Modified: 2013-12-24
Hello,

I need to use either CFGRAPH or CFCHART  to do the following.

I have a form that a user places a value from 0 - 10 depending on how they feel about the subject matter for 20 specific questions.  What I need to plot is the question numbers across the horizontal axis and their ratings on the vertical axis.  The values of the 20 individual questions have their own individual columns in the database.  Most of the graph or charting explained in books is average based and not so much pulling 20 individual columns to populate a bar chart; although you can select an individual column there is no way to select all 20 columns across 1 individual row.  I figure this may be an easy task and I am over thinking the solution.

Database Table is as follows (SQL Server):

ID  = "int"  (PK)
Name = "nvarchar"  (FK)
[1] THROUGH [24] = "numeric"

I'd give a 500 Bonus Points total for help.

Thanks for your help....
Fusionite...
0
Comment
Question by:Fusionite
[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
  • 3
  • 2
  • 2
10 Comments
 
LVL 1

Expert Comment

by:nickj224
ID: 13577147
I am not 100% sure what you are asking, but I think what you are trying to accomplish can be done with the cfchartdata tag.  CFGRAPH is depreciated after CF5, so I would use CFCHART depending on what version of CF you are using.

<cfchart *attributes*>

   <cfchartseries type="bar">

        <cfloop index="x" from="1" to="20">

              <cfchartdata item="#x#" value="#myquery.mycolumn#">

        </cfloop>

   </cfchartseries>

</cfchart>

Hope this helps
0
 

Author Comment

by:Fusionite
ID: 13584211
Hi Nick

Thanks for answering.  Here is the only problem I am having with your code, now it appears that  the limited selection of myquery.mycolumn only displays the value of one of the columns across 24 rows.  Meaning that now instead of the values being 8 for 1, 9 for 2, it is coming up 8 for 1, 8 for 2 all the way to 24 the value is 8.  So it appears that if I specify a single value I only get that value result in all 24 plots.  I tried adding an additional line with a different column number, but it took the value of the second column as well and looped right past.  Here is the code, we are very close, your help is greatly appreciated!  I think if you could tweak the value column in the chartdata segment we should be golden!


<cfchart>

   <cfchartseries type="bar">

        <cfloop index="x" from="#1#" to="#24#">
           
         <cfchartdata item="#x#" value="#plot.1#">
         </cfloop>

   </cfchartseries>

</cfchart>

Thanks for all your help!
Fusionite
0
 
LVL 1

Expert Comment

by:nickj224
ID: 13591511
Just so I understand better, you are looking for 1 chart per person?  I assume this since each record in your DB has 1 column per answer for 20 answers and you want to show 20 bars across.
0
ATEN's HDBaseT Presentation at InfoComm 2017

Hear ATEN Product Manager YT Liang review HDBaseT technology, highlighting ATEN’s latest solutions as they relate to real-world applications during her presentation at the HDBaseT booth at InfoComm 2017.

 
LVL 12

Expert Comment

by:mmc98dl1
ID: 13618593
this should do you:

<cfquery name="getAnswers">
      SELECT *
      FROM Answers
      WHERE Name = 'PersonName'
</cfquery>

<cfchart>
      <cfchartseries type="bar">
            <cfloop index="i" from="1" to="20">
                  <cfchartdata item="#i#" value="#Evaluate("getAnswers.#i#")#">
            </cfloop>
      </cfchartseries>
</cfchart>
0
 

Author Comment

by:Fusionite
ID: 13648906
mmc98dl1 this works fine, but now all my y-axis data is showing up as decimal places.  I wanted the Y-axis to go from 0 - 10 (integers not decimals).  The x-axis is perfect, now if I can get the y right I am all set.  Thanks for your help!

I want the y to show like the following

0 , 1, 2 , 3

my data is coming up

0, 1.1111, 2.2222, 3.3333  etc up to 10.  0 and 10 are the only values appearing as integers everything else is a whole number plus decimal point and 4 places to the right.

Thanks again!

Fusionite.....
0
 
LVL 12

Accepted Solution

by:
mmc98dl1 earned 2000 total points
ID: 13649020
try

<cfchart>
     <cfchartseries type="bar">
          <cfloop index="i" from="1" to="20">
               <cfchartdata item="#i#" value="#NumberFormat(Evaluate("getAnswers.#i#"),"99")#">
          </cfloop>
     </cfchartseries>
</cfchart>

or

<cfchart>
     <cfchartseries type="bar">
          <cfloop index="i" from="1" to="20">
               <cfchartdata item="#i#" value="#listFirst(Evaluate("getAnswers.#i#"),".")#">
          </cfloop>
     </cfchartseries>
</cfchart>
0
 
LVL 12

Expert Comment

by:mmc98dl1
ID: 13881710
I am pretty sure my answer is correct from what I understand, but we never had any feedback.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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