• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfchart, cfchartseries, cfchartdata - HELP

Explorer ,
Oct 10, 2007 Oct 10, 2007

Copy link to clipboard

Copied

I have a feedback table in my database - the fields are: availability, revelancy, timeliness, etc. What I want to do is a bar chart to show the average (user can choose 1-5, 0=N/A) of each of these fields. The beginning of the code is below ...I'm getting all of my data on the page, I just can't get it to display on the chart.

<cfquery name="qry_data" datasource="mydata">
select AVG(availability) AS avgAVAIL,
AVG(revelancy) AS avgREV,
AVG(timeliness) AS avgTIM
FROM feedback
WHERE availability <>0 AND timeliness<>0 AND feedback<>0 <!--this is so that the N/A ones aren't counted in the average-->
</cfquery>

<cfchart
chartWidth = "400"
chartHeight = "400"
yaxistitle="Feedback Average"
xaxistitle="Category">

Now, this is where it gets screwy...I was thinking that I could do a cfloop list of the field names to get them listed - rather than getting the field names from the db
<cfset category="availability, revelancy, timeliness">
<cfloop index="i" list="#category#>

<cfchartseries type="bar"
valuecolumn="" <!-- What goes here???-->
itemcolumn=""> <!-- What goes here???-->

<cfloop query="qry_data">
<cfchartdata item=#i# value=""> <!-- What goes here??? I want the item and the value to match, but the value actually changes everytime, ie avgAVAIL, avgTIM-->
</cfloop>
</cfloop>
</cfchart>

What I want to happen is that is loops through, gets the category "availability" which is displayed on the x-axis and have the average of availablity in bar format on the y-axis (1-5)....then moves on to the next category.

Let me thank you now for ANY help that you can provide.

TOPICS
Advanced techniques

Views

291

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 11, 2007 Oct 11, 2007

Copy link to clipboard

Copied

Can anyone help me w/ this? Have I posted this question in the wrong place, meaning should it be under a different area? Any help would be apprecaited. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 11, 2007 Oct 11, 2007

Copy link to clipboard

Copied

LATEST
There are ways to do it dynamically, but since the query only contains only 3 values why not try this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation