Question Please help with pie chart hell

stickmaster

New member
Local time
Today, 06:13
Joined
Jan 4, 2009
Messages
3
Hi, I really don't seem to be able to understand the chart wizard or explanations found online for using it, maybe it's me and if so I apologise in advance.
The problem, I have a table with two values in it one is total cost for all items (£200) and the other this_cost (£50).
Total cost being total expenditure so far and this cost being the cost of the item just purchased.
I wish to display a pie chart showing this_cost as a percentage of total cost, ie. a blue circle (total cost) with 25% filled in red (this_cost).
I have been pulling my hair out as it is the final piece I need for the project I am doing at work to track inventory.
Please can anyone supply actual code, instruction or even a form / report for me to download and adapt?
Hope someone can help please.
 
Check out the links on this page with any luck you should get some guidance from one of them.
 
Thanks for the links John but I am non the wiser!
In simple terms If I have a table with two values stored in it (x and y), can I make a pie chart showing x as a percentage of y?
If so in the wizard where do I drag x and where do I drag Y ?
Or maybe I need another value (z) which is the calculation of x=what % of Y
?.
The simpler the answer the better, either I can do it with 2 values or I can't ?

:confused:
 
The short answer is (in theory) yes.

The long answer is I spent a bit of time yesterday playing with graphs, and was having trouble organising the data to produce the sort of thing you are after. I've not used graphs in Access before, but will have a bit more of a play with it if I get a spare moment during the day.
 
OK have a look the attached DB. Check out Query1. I've had to include a dummy sale in the table TB_Sale, that I could test for and be sure of getting a consistent result. I've then filtered that out of the forms record set in the forms OnLoad event.
 

Attachments

Last edited:
Well John I have to say that yes that is the result I am after but sorry, I may be too dense to see it but I can't figure out how to apply it. I see how the sales queries tot up the total sales and the total sales for a given item but, I dont understand how the two values get entered into the chart data?
Looking at the chart properties it simply references query1, getting the values from the expression fields so, how come if I create a new query1 that simply returns two values totalcost and itemtotal it does not transfer into the chart?
I think I need a step by step instruction through the chart wizard, or maybe I will try to just draw the chart on form.
something like,
total=200
itemcost=50
percent=(itemcost/total)*100
circlestep=3.6 (360 deg / 100) gives 100 steps of 3.6 degrees to make 1 circle
plot centre x,y draw full circle 0 to 360deg
plot centre x,y draw pie 0 to (percent*3.6)deg

Just need to figure out the drawing commands now and I bet they dont use degrees as an argument.

Thanks John for your time and effort, I do appreciate it I just don't understand how I am to apply it!
:(
 
What you need to do is look at how Query1 is structured. Probably the most important part is the Iif statement that test for the dummy sale and creates What would be column headers.
 
You should also examine the structure of the other queries that are used in the construction of Qurey1.
 

Users who are viewing this thread

Back
Top Bottom