How to add a pie chart to my Access report

流过昼夜 提交于 2019-11-30 07:14:15

(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:

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

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

Choose "Pie Chart" as the chart type

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

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

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

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

Arpit Kesharwani

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#

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!