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
265 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 500 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

Gigs: Get Your Project Delivered by an Expert

Select from 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

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 article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

785 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