Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I create a pie chart (cfchart) using the data from a single column in a database?

Posted on 2007-12-04
3
Medium Priority
?
271 Views
Last Modified: 2013-12-24
I have a database (ms access) that has a field named "completed".  There are 12 records in the Database.
The field is populated with three possible choices:
No Action
On Hold
Completed
My question is how do I create a Pie Chart to show the number of, and  percentages for each of these possibilities?

Thanks,
0
Comment
Question by:ozziemac
3 Comments
 
LVL 9

Expert Comment

by:73Spyder
ID: 20402310
http://www.fusioncharts.com/free/

Check out this companies free charts.  We use the professional set.  You create the xml from your data set and send it into the chart.  Looks way way better than cfchart.

And no... I don't work for the company...just like the charts.
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 20406086
Here is one way.  The advantage of cfchart is its simplicity.  But I agree with 73Spyder.  There are better charting packages out there.
<!--- or change COUNT(*) to a SUM(SomeColumn) if needed --->
<cfquery name="getTotals" datasource="YourAccessDSN">
    SELECT  Completed, COUNT(*) AS NumberCompleted
    FROM    YourTable
    GROUP BY Completed
</cfquery>
 
<cfchart pieslicestyle="solid">
	<cfchartseries type="pie"
		query="getTotals"
		itemcolumn="Completed"
		valuecolumn="NumberCompleted"
		dataLabelStyle="pattern"		
		/>
</cfchart>

Open in new window

0
 

Author Closing Comment

by:ozziemac
ID: 31412555
Worked well.  I will also take your advice and look for a different charting package.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

971 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