Solved

Access 2007 Pie Chart Labels

Posted on 2010-08-26
12
1,599 Views
Last Modified: 2013-11-28
I am trying to create a pie chart in Microsoft Access using a simple crosstab query.  I can get the pie chart to display correctly, except for the labels - all I get for the labels is "Slice 1", "Slice 2", etc.  See attached file - I've included the data from the query as well as a screen shot of the chart with the labels from the report.    

Basically, I'm wanting the labels to pull from the "Status" field, and the values from the "Total Of Total_Facilities" field.
Sample-Qry.xlsx
0
Comment
Question by:ccbailey
  • 6
  • 5
12 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
If you use the data you posted, then simply edit the chart to display the:
Percentage
...and
CategoryName

(You did not say how you tried to create your chart, so I am unsure why you got the results you did...)

Screenshot and sample file attached...

;-)

JeffCoachman
Database20.mdb
untitled.JPG
0
 

Author Comment

by:ccbailey
Comment Utility
I created it using the chart wizard within MS Access, but then I edited the Row Source query to show the values I wanted.  For example, the "Status" field has to be the second field in the query (opposite from how I've shown it in the file), and I've added a "Null" field at the beginning.  My total SQL string is:
SELECT Null AS Expr, qry_Project_Status_Totals_Crosstab.[Total Of Total_Facilities], qry_Project_Status_Totals_Crosstab.Status
FROM qry_Project_Status_Totals_Crosstab;
The strange thing is, I've selected the Percentage and CategoryName as youve suggested (see attachment), but instead of grabbing the "Status" field as the category name, it's assigning "Slice 1", "Slice 2", etc.  I can't figure out how to get it to use the field for the category names.  Is there a better way to create the chart?

Screenshot.jpg
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
Comment Utility
<but then I edited the Row Source query to show the values I wanted. >
Why?
If the values are in the data, there is no need.

I simply used the data you posted (you can still use your Crosstab query for this if the results are the same.)

Then I set the the "Total Of Total_Facilities" in the Data area, and then I set "Status" as the Series.

Then as I stated, I simply edited the chart to display the:
Percentage
...and
CategoryName.

Now keep in min that if you based the Chart on the raw data, it would have created a summary query for you.
This is sometimes easier as the chart wizard "usually" makes good assumptions about your chart.

;-)

JeffCoachman
untitled.JPG
0
 

Author Comment

by:ccbailey
Comment Utility
I edited the data because my chart was blank, but let me try it like you have it - I'll get right back to you.
0
 

Author Comment

by:ccbailey
Comment Utility
OK, I narrowed down my problem - I tried recreating the chart exactly the way you showed, and it came up blank again.  So then I opened a new, blank report and tried again - it worked like a charm!  The deal is, I have data that displays above the chart, and I want the chart to show in the report footer (below the sums - see attachment).  Is there a way to make it display correctly in the footer, or should I just create it in a subreport and place the subreport in the footer?
Thanks for the help!

Exhibit-B-5.pdf
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Accepted Solution

by:
ccbailey earned 0 total points
Comment Utility
OK, I got it - I did put the chart on a blank report, inserting as a subreport on the final product, and that cleared up my label issues.  Thanks for the help - it was helpful to know what it "should" do that prompted me that the problem didn't lie with the chart itself, rather with the location of the chart.  Who'd have thunk!  Thanks!
0
 

Author Comment

by:ccbailey
Comment Utility
Not sure what I did - I was not intending to close the question - I meant to give partial credit (and all points) to the second expert comment above, and also mark my final answer as the solution.  Sorry for the confusion.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Please click the "Request Attention" button and explain what you want to do with regard to closing this question.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Creating the exact same chart in the Report Footer worked fine for me...

But as long as you have it working, then it's all good...
;-)

Jeff
0
 

Author Comment

by:ccbailey
Comment Utility
OK, I requested attention and explained the deal.  Thanks for the help.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
OK
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

762 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

6 Experts available now in Live!

Get 1:1 Help Now