Solved

Access 2007 Pie Chart Labels

Posted on 2010-08-26
12
1,661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33532567
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
ID: 33532937
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
ID: 33533232
<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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:ccbailey
ID: 33533453
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
ID: 33533781
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
 

Accepted Solution

by:
ccbailey earned 0 total points
ID: 33534838
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
ID: 33534940
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
ID: 33536332
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
ID: 33536371
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
ID: 33536431
OK, I requested attention and explained the deal.  Thanks for the help.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33536687
OK
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

690 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