CFCHART or CFGRAPH

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...
FusioniteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nickj224Commented:
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
FusioniteAuthor Commented:
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
nickj224Commented:
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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

mmc98dl1Commented:
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
FusioniteAuthor Commented:
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
mmc98dl1Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mmc98dl1Commented:
I am pretty sure my answer is correct from what I understand, but we never had any feedback.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.