How to add a pie chart to my Access report
Asked Answered
M

2

8

I have a table that shows "DONE" and "REMAIN" for each "AREA" like below:

 AREA       DONE    REMAIN TOTAL
 AREA1      100     200     300
 AREA2      200     300     500
 AREA3      200     700     900

Now I like to make a report that shows "DONE" and "REMAIN" in each AREA with pie chart, now I have problem how I have to do this job for the graph, how should be "row source" of chart control. What query needs on this table?

Me answered 11/10, 2013 at 7:50 Comment(2)
Just to be clear: You want three separate pie charts, one for each AREA, correct?Vitrain
yes, i want three separate pie charts, one for each AREA.Me
V
12

(I'll assume that your table is named [AREAS].)

The trick here is to create a saved UNION query named [AreaDataForPieChart]...

SELECT "DONE" AS PieCategory, [DONE] AS PieValue, [AREA] FROM [AREAS]
UNION ALL
SELECT "REMAIN" AS PieCategory, [REMAIN] AS PieValue, [AREA] FROM [AREAS]

...returning...

PieCategory  PieValue  AREA 
-----------  --------  -----
DONE              100  AREA1
DONE              200  AREA2
DONE              200  AREA3
REMAIN            200  AREA1
REMAIN            300  AREA2
REMAIN            700  AREA3

...and base the pie chart on that.

Start by creating a Report based on the [AREAS] table, and display [AREA] in a text box:

Report1.png

Now add a Chart control to the Detail band of the report. When prompted, choose the saved query we created above

ChooseQuery.png

Choose [PieCategory] and [PieValue] as the columns for the chart

ChooseColumns.png

Choose "Pie Chart" as the chart type

ChooseChartType.png

The default data layout will work fine because of the order of the columns in our query

DataLayout.png

Tell the report to link the chart to the main report by using the [AREA] fields

Linking.png

Give the chart a meaningful title, then click the "Finish" button.

Finish.png

Now preview the report. It should look something like this:

Results.png

Vitrain answered 11/10, 2013 at 21:20 Comment(0)
M
0

Follow the below link:

A simple way to use pie chart in ms access I tried with the

SELECT status, Count(status) AS count FROM Table1 group by status;

Query in Row source of pie chart properties.

The first column will display as a label of the pie chart and 2nd column will display the count.

http://www.worldbestlearningcenter.com/index_files/Access-vba-piechart.htm#

Madel answered 30/7, 2017 at 6:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.