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
262 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
Comment Utility
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
Comment Utility
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
Comment Utility
Worked well.  I will also take your advice and look for a different charting package.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now